Interface DownloadManagerStats
- All Known Implementing Classes:
DownloadManagerStatsImpl
-
Method Summary
Modifier and TypeMethodDescriptionfloat
long
long
int
Find out percentage done of current statelong
long
long
int
getDownloadCompleted
(boolean bLive) Retrieve the level of download completion, *including* DND files.long
Get the number of bytes of the download that we currently have.int
Get the max download rate allowed for this download.long
getETA()
*deprecated - use getSmoothedETA as the unstability of getETA is pretty badint[]
long
long
long
long
int
long
long
int[][]
Get any recent history.long
Returns the bytes remaining.long
long
long
long
long
int
Gives the share ratio of the torrent in 1000ths (i.e.long
long
long
long
default int
int
getTimeSinceLastDataReceivedInSeconds
(boolean this_session) default int
int
getTimeSinceLastDataSentInSeconds
(boolean this_session) long
long
long
Swarm speedlong
Average for a peer in the swarmlong
Get the total number of bytes ever downloaded.long
Get the total number of bytes ever uploaded.long
data bytes received minus discards and hashfailslong
long
int
Get the max upload rate allowed for this download.void
void
resetTotalBytesSentReceived
(long sent, long received) Resets the total bytes sent/received - will stop and start the download if it is runningvoid
restoreSessionTotals
(long _saved_data_bytes_downloaded, long _saved_data_bytes_uploaded, long _saved_discarded, long _saved_hashfails, long _saved_SecondsDownloading, long _saved_SecondsOnlySeeding) void
setCompleted
(int c) void
setDownloadCompletedBytes
(long completedBytes) void
setDownloadRateLimitBytesPerSecond
(int max_rate_bps) Set the max download rate allowed for this download.void
setRecentHistoryRetention
(boolean required) In general history isn't available, however if this method is called it will start retention for a certain period of timevoid
setShareRatio
(int ratio) void
setUploadRateLimitBytesPerSecond
(int max_rate_bps) Set the max upload rate allowed for this download.
-
Method Details
-
getCompleted
int getCompleted()Find out percentage done of current stateUse getDownloadCompleted() if you wish to find out a torrents download completion level
- Returns:
- 0 to 1000, 0% to 100% respectively When state is Allocating, Checking, or Initializing, this returns the % done of that task Any other state MAY return getDownloadCompleted()
-
getDownloadCompleted
int getDownloadCompleted(boolean bLive) Retrieve the level of download completion, *including* DND files.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_SEEDINGWhile 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 torrentfalse - In the case of ST_PREPARING, return completion level before of the torrent ST_PREPARING started. Otherwise, same as true.
- Returns:
- 0 - 1000
-
setDownloadCompletedBytes
void setDownloadCompletedBytes(long completedBytes) -
getDownloadCompletedBytes
long getDownloadCompletedBytes()Get the number of bytes of the download that we currently have.Includes bytes downloaded for files marked as DND/Skipped
-
recalcDownloadCompleteBytes
void recalcDownloadCompleteBytes() -
getTotalDataBytesReceived
long getTotalDataBytesReceived()Get the total number of bytes ever downloaded.- Returns:
- total bytes downloaded
-
getTotalGoodDataBytesReceived
long getTotalGoodDataBytesReceived()data bytes received minus discards and hashfails- Returns:
-
getTotalProtocolBytesReceived
long getTotalProtocolBytesReceived() -
getSessionDataBytesReceived
long getSessionDataBytesReceived() -
getTotalDataBytesSent
long getTotalDataBytesSent()Get the total number of bytes ever uploaded.- Returns:
- total bytes uploaded
-
getTotalProtocolBytesSent
long getTotalProtocolBytesSent() -
getSessionDataBytesSent
long getSessionDataBytesSent() -
resetTotalBytesSentReceived
void resetTotalBytesSentReceived(long sent, long received) Resets the total bytes sent/received - will stop and start the download if it is running -
getRemaining
long getRemaining()Returns the bytes remaining. *Includes* DND files -
getDiscarded
long getDiscarded() -
getHashFailBytes
long getHashFailBytes() -
getHashFailCount
long getHashFailCount() -
getDataReceiveRate
long getDataReceiveRate() -
getProtocolReceiveRate
long getProtocolReceiveRate() -
getDataSendRate
long getDataSendRate() -
getProtocolSendRate
long getProtocolSendRate() -
getTotalAverage
long getTotalAverage()Swarm speed- Returns:
-
getTotalAveragePerPeer
long getTotalAveragePerPeer()Average for a peer in the swarm- Returns:
-
setRecentHistoryRetention
void setRecentHistoryRetention(boolean required) In general history isn't available, however if this method is called it will start retention for a certain period of time -
getRecentHistory
int[][] getRecentHistory()Get any recent history. Returned values are send rate, receive rate, peer-swarm average and eta- Returns:
-
getElapsedTime
String getElapsedTime() -
getTimeStarted
long getTimeStarted() -
getTimeStartedSeeding
long getTimeStartedSeeding() -
getETA
long getETA()*deprecated - use getSmoothedETA as the unstability of getETA is pretty bad- Returns:
-
getSmoothedETA
long getSmoothedETA() -
getPeakDataReceiveRate
long getPeakDataReceiveRate() -
getPeakDataSendRate
long getPeakDataSendRate() -
getSmoothedDataReceiveRate
long getSmoothedDataReceiveRate() -
getSmoothedDataSendRate
long getSmoothedDataSendRate() -
getAvailability
float getAvailability() -
getSecondsDownloading
long getSecondsDownloading() -
getSecondsOnlySeeding
long getSecondsOnlySeeding() -
setCompleted
void setCompleted(int c) -
getUploadRateLimitBytesPerSecond
int getUploadRateLimitBytesPerSecond()Get the max upload rate allowed for this download.- Returns:
- upload rate in bytes per second, 0 for unlimited, -1 for upload disabled
-
setUploadRateLimitBytesPerSecond
void setUploadRateLimitBytesPerSecond(int max_rate_bps) Set the max upload rate allowed for this download.- Parameters:
max_rate_bps
- limit in bytes per second, 0 for unlimited, -1 for upload disabled
-
getDownloadRateLimitBytesPerSecond
int getDownloadRateLimitBytesPerSecond()Get the max download rate allowed for this download.- Returns:
- download rate in bytes per second, 0 for unlimited, -1 for download disabled
-
setDownloadRateLimitBytesPerSecond
void setDownloadRateLimitBytesPerSecond(int max_rate_bps) Set the max download rate allowed for this download.- Parameters:
max_rate_bps
- limit in bytes per second, 0 for unlimited, -1 for download disabled
-
getTimeSinceLastDataReceivedInSeconds
default int getTimeSinceLastDataReceivedInSeconds() -
getTimeSinceLastDataSentInSeconds
default int getTimeSinceLastDataSentInSeconds() -
getTimeSinceLastDataReceivedInSeconds
int getTimeSinceLastDataReceivedInSeconds(boolean this_session) -
getTimeSinceLastDataSentInSeconds
int getTimeSinceLastDataSentInSeconds(boolean this_session) -
getAvailWentBadTime
long getAvailWentBadTime()- Returns:
- -1: never seen a whole copy; 0: currently good; >0: time availability went from good to bad
-
restoreSessionTotals
void restoreSessionTotals(long _saved_data_bytes_downloaded, long _saved_data_bytes_uploaded, long _saved_discarded, long _saved_hashfails, long _saved_SecondsDownloading, long _saved_SecondsOnlySeeding) -
getRemainingExcludingDND
long getRemainingExcludingDND() -
getSizeExcludingDND
long getSizeExcludingDND() -
getPercentDoneExcludingDND
int getPercentDoneExcludingDND() -
getFilePriorityStats
int[] getFilePriorityStats()
-