Class RPDownloadStats
java.lang.Object
com.biglybt.pifimpl.remote.RPObject
com.biglybt.pifimpl.remote.download.RPDownloadStats
- All Implemented Interfaces:
DownloadStats, Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloatlongintprotected DownloadStatslongintintlongintintlonglongFields inherited from class RPObject
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverseFields inherited from interface DownloadStats
HEALTH_ERROR, HEALTH_KO, HEALTH_NO_REMOTE, HEALTH_NO_TRACKER, HEALTH_OK, HEALTH_STOPPED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_setDelegate(Object _delegate) static RPDownloadStatscreate(DownloadStats _delegate) floatGives the currently seen availability of the torrentlongReturn the number of bytes of data fromt he torrent that is unavailable given the current sources (peers).intif isChecking then returns completeness, 1000 -> 100%intreturns a value between 0 and 1000 giving the completion status of the current download task (e.g.longGives the number of bytes discarded.longGives average number of bytes downloaded in last secondlonggetDownloadAverage(boolean include_protocol) intgetDownloadCompleted(boolean bLive) Retrieve the level of download completion, *including* DND files.Gives access to the directory into which the download is being savedlongGives the number of bytes downloadedlonggetDownloaded(boolean include_protocol) Gives the elapsed download time as a stringgetETA()Gives the estimated time to completion as a stringlongETA time in seconds.longGives the number of bytes thrown away due to piece hash check failsintreturns an indication of the health of the torrentlongGives number of bytes remaining.longlongReturn the # of seconds that the torrent has been downloading.longReturn the # of seconds that the torrent has been only seeding.longReturns the number of seconds running time since data was downloaded, -1 if neverlongReturns the number of seconds running time since data was uploaded, -1 if neverintGives the share ratio of the torrent in 1000ths (i.e.Returns an overall string representing the state of the downloadgetStatus(boolean localised) Returns an overall string representing the state of the download *localised*Gives access to the target file or directory that the download is being saved tolongin ms since epochlongTime that the torrent started seeding.longGives average number of bytes computed for torrent in last secondreturns an general status string for the trackerlongGives average number of bytes uploaded in last secondlonggetUploadAverage(boolean include_protocol) longGives the number of bytes uploadedlonggetUploaded(boolean include_protocol) voidresetUploadedDownloaded(long l1, long l2) resets totals.Methods inherited from class RPObject
_fixupLocal, _getDelegate, _getName, _getOID, _lookupLocal, _lookupLocal, _refresh, _setRemote, getDispatcher, notSupported, notSupported
-
Field Details
-
delegate
-
downloaded
public long downloaded -
uploaded
public long uploaded -
completed
public int completed -
downloadCompletedLive
public int downloadCompletedLive -
downloadCompletedStored
public int downloadCompletedStored -
status
-
status_localised
-
upload_average
public long upload_average -
download_average
public long download_average -
eta
-
availability
public float availability -
health
public int health
-
-
Constructor Details
-
RPDownloadStats
-
-
Method Details
-
create
-
_setDelegate
- Overrides:
_setDelegatein classRPObject
-
_setLocal
- Overrides:
_setLocalin classRPObject- Throws:
RPException
-
_process
-
getStatus
Description copied from interface:DownloadStatsReturns an overall string representing the state of the download- Specified by:
getStatusin interfaceDownloadStats- Returns:
-
getStatus
Description copied from interface:DownloadStatsReturns an overall string representing the state of the download *localised*- Specified by:
getStatusin interfaceDownloadStats- Returns:
-
getDownloadDirectory
Description copied from interface:DownloadStatsGives access to the directory into which the download is being saved- Specified by:
getDownloadDirectoryin interfaceDownloadStats- Returns:
-
getTargetFileOrDir
Description copied from interface:DownloadStatsGives access to the target file or directory that the download is being saved to- Specified by:
getTargetFileOrDirin interfaceDownloadStats- Returns:
-
getTrackerStatus
Description copied from interface:DownloadStatsreturns an general status string for the tracker- Specified by:
getTrackerStatusin interfaceDownloadStats- Returns:
-
getCompleted
public int getCompleted()Description copied from interface:DownloadStatsreturns a value between 0 and 1000 giving the completion status of the current download task (e.g. checking, downloading)- Specified by:
getCompletedin interfaceDownloadStats- Returns:
-
getDownloadCompleted
public int getDownloadCompleted(boolean bLive) Description copied from interface:DownloadStatsRetrieve the level of download completion, *including* DND files. If the user has one or more DND file, return value will never reach 1000.To understand the bLive parameter, you must know a bit about the Torrent activation process:
1) Torrent goes into ST_WAITING
2) Torrent moves to ST_PREPARING
3) Torrent moves to ST_DOWNLOADING or ST_SEEDING
While in ST_PREPARING, Completion Level is rebuilt (either via Fast Resume or via piece checking). Quite often, the download completion level before ST_PREPARING and after ST_PREPARING are identical.
Before going into ST_PREPARING, we store the download completion level. If you wish to retrieve this value instead of the live "building" one, pass false for the parameter.
- Specified by:
getDownloadCompletedin interfaceDownloadStats- Parameters:
bLive- true - Always returns the known completion level of the torrent false - In the case of ST_PREPARING, return completion level before of the torrent ST_PREPARING started. Otherwise, same as true.- Returns:
- 0 - 1000
-
getCheckingDoneInThousandNotation
public int getCheckingDoneInThousandNotation()Description copied from interface:DownloadStatsif isChecking then returns completeness, 1000 -> 100%- Specified by:
getCheckingDoneInThousandNotationin interfaceDownloadStats- Returns:
-
resetUploadedDownloaded
public void resetUploadedDownloaded(long l1, long l2) Description copied from interface:DownloadStatsresets totals. stops and restarts torrent if running to do so- Specified by:
resetUploadedDownloadedin interfaceDownloadStats
-
getDownloaded
public long getDownloaded()Description copied from interface:DownloadStatsGives the number of bytes downloaded- Specified by:
getDownloadedin interfaceDownloadStats- Returns:
-
getDownloaded
public long getDownloaded(boolean include_protocol) - Specified by:
getDownloadedin interfaceDownloadStats- Parameters:
include_protocol-- Returns:
-
getUploaded
public long getUploaded()Description copied from interface:DownloadStatsGives the number of bytes uploaded- Specified by:
getUploadedin interfaceDownloadStats- Returns:
-
getUploaded
public long getUploaded(boolean include_protocol) - Specified by:
getUploadedin interfaceDownloadStats- Parameters:
include_protocol-- Returns:
-
getRemaining
public long getRemaining()Description copied from interface:DownloadStatsGives number of bytes remaining. *Includes* DND files- Specified by:
getRemainingin interfaceDownloadStats
-
getDiscarded
public long getDiscarded()Description copied from interface:DownloadStatsGives the number of bytes discarded. Does not includeDownloadStats.getHashFails()(ex. end game mode where multiple peers send same block, et)- Specified by:
getDiscardedin interfaceDownloadStats- Returns:
-
getDownloadAverage
public long getDownloadAverage()Description copied from interface:DownloadStatsGives average number of bytes downloaded in last second- Specified by:
getDownloadAveragein interfaceDownloadStats- Returns:
-
getDownloadAverage
public long getDownloadAverage(boolean include_protocol) - Specified by:
getDownloadAveragein interfaceDownloadStats- Parameters:
include_protocol-- Returns:
-
getUploadAverage
public long getUploadAverage()Description copied from interface:DownloadStatsGives average number of bytes uploaded in last second- Specified by:
getUploadAveragein interfaceDownloadStats- Returns:
-
getUploadAverage
public long getUploadAverage(boolean include_protocol) - Specified by:
getUploadAveragein interfaceDownloadStats- Parameters:
include_protocol-- Returns:
-
getTotalAverage
public long getTotalAverage()Description copied from interface:DownloadStatsGives average number of bytes computed for torrent in last second- Specified by:
getTotalAveragein interfaceDownloadStats- Returns:
-
getElapsedTime
Description copied from interface:DownloadStatsGives the elapsed download time as a string- Specified by:
getElapsedTimein interfaceDownloadStats- Returns:
-
getETA
Description copied from interface:DownloadStatsGives the estimated time to completion as a string- Specified by:
getETAin interfaceDownloadStats- Returns:
-
getETASecs
public long getETASecs()Description copied from interface:DownloadStatsETA time in seconds.- Specified by:
getETASecsin interfaceDownloadStats- Returns:
- 0 = download is complete.
invalid input: '<' 0 = download is complete and it took -xxx time to complete.
-1 = unknown eta (no peer manager) or download completed 1s ago
315360000000L = incomplete and 0 average speed
-
getHashFails
public long getHashFails()Description copied from interface:DownloadStatsGives the number of bytes thrown away due to piece hash check fails- Specified by:
getHashFailsin interfaceDownloadStats- Returns:
-
getTimeStarted
public long getTimeStarted()Description copied from interface:DownloadStatsin ms since epoch- Specified by:
getTimeStartedin interfaceDownloadStats
-
getAvailability
public float getAvailability()Description copied from interface:DownloadStatsGives the currently seen availability of the torrent- Specified by:
getAvailabilityin interfaceDownloadStats- Returns:
-
getSecondsDownloading
public long getSecondsDownloading()Description copied from interface:DownloadStatsReturn the # of seconds that the torrent has been downloading. This number is totalled across sessions.- Specified by:
getSecondsDownloadingin interfaceDownloadStats- Returns:
- -1 if it has never downloaded
-
getSecondsOnlySeeding
public long getSecondsOnlySeeding()Description copied from interface:DownloadStatsReturn the # of seconds that the torrent has been only seeding. This number is totalled across sessions, and does not include the time seeding during the download phase.- Specified by:
getSecondsOnlySeedingin interfaceDownloadStats- Returns:
- -1 if it has never seeded
-
getTimeStartedSeeding
public long getTimeStartedSeeding()Description copied from interface:DownloadStatsTime that the torrent started seeding.- Specified by:
getTimeStartedSeedingin interfaceDownloadStats- Returns:
- the difference, measured in milliseconds, between the torrent started seeding and midnight, January 1, 1970 UTC. see SystemTime.getCurrentTime(). -1 is not seeding
-
getSecondsSinceLastDownload
public long getSecondsSinceLastDownload()Description copied from interface:DownloadStatsReturns the number of seconds running time since data was downloaded, -1 if never- Specified by:
getSecondsSinceLastDownloadin interfaceDownloadStats- Returns:
-
getSecondsSinceLastUpload
public long getSecondsSinceLastUpload()Description copied from interface:DownloadStatsReturns the number of seconds running time since data was uploaded, -1 if never- Specified by:
getSecondsSinceLastUploadin interfaceDownloadStats- Returns:
-
getHealth
public int getHealth()Description copied from interface:DownloadStatsreturns an indication of the health of the torrent- Specified by:
getHealthin interfaceDownloadStats- Returns:
- see above HEALTH constants
-
getRemainingExcludingDND
public long getRemainingExcludingDND()- Specified by:
getRemainingExcludingDNDin interfaceDownloadStats
-