Package DebTorrent :: Package BT1 :: Module Statistics :: Class Statistics
[hide private]
[frames] | no frames]

Class Statistics

source code

Generate statistics for the swarm.

Instance Methods [hide private]
 
__init__(self, upmeasure, downmeasure, connecter, httpdl, ratelimiter, rerequest_lastfailed, fdatflag)
Initialize the instance.
source code
 
set_dirstats(self, files, piece_lengths)
Initialize the statistics for the files in the download.
source code
Statistics_Response
update(self)
Generate the statistics response.
source code
Instance Variables [hide private]
Connecter.Connecter connecter
the Connecter instance that manages all the connections
Downloader.Downloader downloader
the Downloader instance to use
CurrentRateMeasure.Measure downmeasure
the measure of the download rate
boolean fdatactive
not used
threading.Event fdatflag
not used
list of float fileamtdone
for each file, the fraction of the file that is downloaded and in place
list of boolean filecomplete
whether each file has been completely downloaded
list of boolean fileinplace
whether each file has been put in its proper place
threading.Event filelistupdated
whether the file list has been updated
list of list of int filepieces
for each file, a list of pieces that are not yet downloaded
list of list of int filepieces2
for each file, a list of pieces that are not yet in place
BT1.HTTPDownloader.HTTPDownloader httpdl
the backup HTTP downloader
PiecePicker.PiecePicker picker
the PiecePicker instance
int piecescomplete
the number of complete pieces the last time the statistics were generated
int placesopen
the number of out of place pieces there were the last time the statistics were generated
RateLimiter.RateLimiter ratelimiter
the RateLimiter instance to limit the upload rate
method rerequest_lastfailed
method to call to check if the last tracker request failed
StorageWrapper.StorageWrapper storage
the StorageWrapper instance
int storage_totalpieces
the total number of pieces in the download
DebTorrent.CurrentRateMeasure.Measure torrentmeasure
for measuring the total download rate from all peers
CurrentRateMeasure.Measure upmeasure
the measure of the upload rate
Method Details [hide private]

__init__(self, upmeasure, downmeasure, connecter, httpdl, ratelimiter, rerequest_lastfailed, fdatflag)
(Constructor)

source code 
Initialize the instance.
Parameters:

set_dirstats(self, files, piece_lengths)

source code 
Initialize the statistics for the files in the download.
Parameters:
  • files (list of (string, long)) - the full file names and lengths of all the files in the download
  • piece_lengths (list of int) - the lengths of the pieces

update(self)

source code 
Generate the statistics response.
Returns: Statistics_Response
the response containing instance variables that are the generated statistics