Package com.biglybt.pif.download
Interface DownloadStats
- All Known Implementing Classes:
DownloadStatsImpl
,RPDownloadStats
public interface DownloadStats
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
download in STATE_ERROR, seegetStatus()
for errorstatic final int
not connected to any peer and downloadingstatic final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionfloat
Gives the currently seen availability of the torrentlong
Return the number of bytes of data fromt he torrent that is unavailable given the current sources (peers).int
if isChecking then returns completeness, 1000 -> 100%int
returns a value between 0 and 1000 giving the completion status of the current download task (e.g.long
Gives the number of bytes discarded.long
Gives average number of bytes downloaded in last secondlong
getDownloadAverage
(boolean include_protocol) int
getDownloadCompleted
(boolean bLive) Retrieve the level of download completion, *including* DND files.Gives access to the directory into which the download is being savedlong
Gives the number of bytes downloadedlong
getDownloaded
(boolean include_protocol) Gives the elapsed download time as a stringgetETA()
Gives the estimated time to completion as a stringlong
ETA time in seconds.long
Gives the number of bytes thrown away due to piece hash check failsint
returns an indication of the health of the torrentlong
Gives number of bytes remaining.long
long
Return the # of seconds that the torrent has been downloading.long
Return the # of seconds that the torrent has been only seeding.long
Returns the number of seconds running time since data was downloaded, -1 if neverlong
Returns the number of seconds running time since data was uploaded, -1 if neverint
Gives 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 tolong
in ms since epochlong
Time that the torrent started seeding.long
Gives average number of bytes computed for torrent in last secondreturns an general status string for the trackerlong
Gives average number of bytes uploaded in last secondlong
getUploadAverage
(boolean include_protocol) long
Gives the number of bytes uploadedlong
getUploaded
(boolean include_protocol) void
resetUploadedDownloaded
(long new_up, long new_down) resets totals.
-
Field Details
-
HEALTH_STOPPED
static final int HEALTH_STOPPED- See Also:
-
HEALTH_NO_TRACKER
static final int HEALTH_NO_TRACKER- See Also:
-
HEALTH_NO_REMOTE
static final int HEALTH_NO_REMOTE- See Also:
-
HEALTH_OK
static final int HEALTH_OK- See Also:
-
HEALTH_KO
static final int HEALTH_KOnot connected to any peer and downloading- See Also:
-
HEALTH_ERROR
static final int HEALTH_ERRORdownload in STATE_ERROR, seegetStatus()
for error- See Also:
-
-
Method Details
-
getStatus
String getStatus()Returns an overall string representing the state of the download- Returns:
- Since:
- 2.0.7.0
-
getStatus
Returns an overall string representing the state of the download *localised*- Returns:
- Since:
- 2.3.0.7
-
getDownloadDirectory
String getDownloadDirectory()Gives access to the directory into which the download is being saved- Returns:
- Since:
- 2.0.7.0
-
getTargetFileOrDir
String getTargetFileOrDir()Gives access to the target file or directory that the download is being saved to- Returns:
- Since:
- 2.0.7.0
-
getTrackerStatus
String getTrackerStatus()returns an general status string for the tracker- Returns:
- Since:
- 2.0.7.0
-
getCompleted
int getCompleted()returns a value between 0 and 1000 giving the completion status of the current download task (e.g. checking, downloading)- Returns:
- Since:
- 2.0.7.0
-
getDownloadCompleted
int getDownloadCompleted(boolean bLive) Retrieve 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.
- 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
- Since:
- 2.0.8.0
-
getCheckingDoneInThousandNotation
int getCheckingDoneInThousandNotation()if isChecking then returns completeness, 1000 -> 100%- Returns:
-
resetUploadedDownloaded
void resetUploadedDownloaded(long new_up, long new_down) resets totals. stops and restarts torrent if running to do so- Since:
- 4511. Supply -1 to leave a value unchanged
-
getDownloaded
long getDownloaded()Gives the number of bytes downloaded- Returns:
- Since:
- 2.0.7.0
-
getDownloaded
long getDownloaded(boolean include_protocol) - Parameters:
include_protocol
-- Returns:
- Since:
- 5.1.0.1
-
getRemaining
long getRemaining()Gives number of bytes remaining. *Includes* DND files- Since:
- 2.5.0.2
-
getRemainingExcludingDND
long getRemainingExcludingDND() -
getUploaded
long getUploaded()Gives the number of bytes uploaded- Returns:
- Since:
- 2.0.7.0
-
getUploaded
long getUploaded(boolean include_protocol) - Parameters:
include_protocol
-- Returns:
- Since:
- 5.1.0.1
-
getDiscarded
long getDiscarded()Gives the number of bytes discarded. Does not includegetHashFails()
(ex. end game mode where multiple peers send same block, et)- Returns:
- Since:
- 2.0.7.0
-
getDownloadAverage
long getDownloadAverage()Gives average number of bytes downloaded in last second- Returns:
- Since:
- 2.0.7.0
-
getDownloadAverage
long getDownloadAverage(boolean include_protocol) - Parameters:
include_protocol
-- Returns:
- Since:
- 5.1.0.1
-
getUploadAverage
long getUploadAverage()Gives average number of bytes uploaded in last second- Returns:
- Since:
- 2.0.7.0
-
getUploadAverage
long getUploadAverage(boolean include_protocol) - Parameters:
include_protocol
-- Returns:
- Since:
- 5.1.0.1
-
getTotalAverage
long getTotalAverage()Gives average number of bytes computed for torrent in last second- Returns:
- Since:
- 2.0.7.0
-
getElapsedTime
String getElapsedTime()Gives the elapsed download time as a string- Returns:
- Since:
- 2.0.7.0
-
getETA
String getETA()Gives the estimated time to completion as a string- Returns:
- Since:
- 2.0.7.0
-
getETASecs
long getETASecs()ETA time in seconds.- 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 - Since:
- 4.2.0.3
-
getHashFails
long getHashFails()Gives the number of bytes thrown away due to piece hash check fails- Returns:
- Since:
- 2.0.7.0
-
getTimeStarted
long getTimeStarted()in ms since epoch- Since:
- 2.0.8.0
-
getTimeStartedSeeding
long getTimeStartedSeeding()Time that the torrent started seeding.- Returns:
- the difference, measured in milliseconds, between the torrent started seeding and midnight, January 1, 1970 UTC. see SystemTime.getCurrentTime(). -1 is not seeding
- Since:
- 2.1.0.0
-
getAvailability
float getAvailability()Gives the currently seen availability of the torrent- Returns:
- Since:
- 2.0.8.2
-
getSecondsDownloading
long getSecondsDownloading()Return the # of seconds that the torrent has been downloading. This number is totalled across sessions.- Returns:
- -1 if it has never downloaded
- Since:
- 2.1.0.0
-
getSecondsOnlySeeding
long getSecondsOnlySeeding()Return 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.- Returns:
- -1 if it has never seeded
- Since:
- 2.1.0.0
-
getSecondsSinceLastDownload
long getSecondsSinceLastDownload()Returns the number of seconds running time since data was downloaded, -1 if never- Returns:
- Since:
- 2501
-
getSecondsSinceLastUpload
long getSecondsSinceLastUpload()Returns the number of seconds running time since data was uploaded, -1 if never- Returns:
- Since:
- 2501
-
getHealth
int getHealth()returns an indication of the health of the torrent- Returns:
- see above HEALTH constants
-