org.gudy.azureus2.core3.download
Interface DownloadManagerStats

All Known Implementing Classes:
DownloadManagerStatsImpl

public interface DownloadManagerStats

Author:
parg

Method Summary
 float getAvailability()
           
 long getAvailWentBadTime()
           
 long getBytesUnavailable()
           
 int getCompleted()
          Find out percentage done of current state
 long getDataReceiveRate()
           
 long getDataSendRate()
           
 long getDiscarded()
           
 int getDownloadCompleted(boolean bLive)
          Retrieve the level of download completion, *including* DND files.
 long getDownloadCompletedBytes()
          Get the number of bytes of the download that we currently have.
 int getDownloadRateLimitBytesPerSecond()
          Get the max download rate allowed for this download.
 String getElapsedTime()
           
 long getETA()
          *deprecated - use getSmoothedETA as the unstability of getETA is pretty bad
 long getHashFailBytes()
           
 long getHashFailCount()
           
 long getPeakDataReceiveRate()
           
 long getPeakDataSendRate()
           
 int getPercentDoneExcludingDND()
           
 long getProtocolReceiveRate()
           
 long getProtocolSendRate()
           
 int[][] getRecentHistory()
          Get any recent history.
 long getRemaining()
          Returns the bytes remaining.
 long getRemainingExcludingDND()
           
 long getSecondsDownloading()
           
 long getSecondsOnlySeeding()
           
 long getSessionDataBytesReceived()
           
 long getSessionDataBytesSent()
           
 int getShareRatio()
          Gives the share ratio of the torrent in 1000ths (i.e.
 long getSizeExcludingDND()
           
 long getSmoothedDataReceiveRate()
           
 long getSmoothedDataSendRate()
           
 long getSmoothedETA()
           
 int getTimeSinceLastDataReceivedInSeconds()
           
 int getTimeSinceLastDataSentInSeconds()
           
 long getTimeStarted()
           
 long getTimeStartedSeeding()
           
 long getTotalAverage()
          Swarm speed
 long getTotalAveragePerPeer()
          Average for a peer in the swarm
 long getTotalDataBytesReceived()
          Get the total number of bytes ever downloaded.
 long getTotalDataBytesSent()
          Get the total number of bytes ever uploaded.
 long getTotalGoodDataBytesReceived()
          data bytes received minus discards and hashfails
 long getTotalProtocolBytesReceived()
           
 long getTotalProtocolBytesSent()
           
 int getUploadRateLimitBytesPerSecond()
          Get the max upload rate allowed for this download.
 void recalcDownloadCompleteBytes()
           
 void resetTotalBytesSentReceived(long sent, long received)
          Resets the total bytes sent/received - will stop and start the download if it is running
 void 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 time
 void setShareRatio(int ratio)
           
 void setUploadRateLimitBytesPerSecond(int max_rate_bps)
          Set the max upload rate allowed for this download.
 

Method Detail

getCompleted

int getCompleted()
Find out percentage done of current state

Use 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_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

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()

getShareRatio

int getShareRatio()
Gives the share ratio of the torrent in 1000ths (i.e. 1000 = share ratio of 1)


setShareRatio

void setShareRatio(int ratio)

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 and peer-swarm average

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

int getTimeSinceLastDataReceivedInSeconds()

getTimeSinceLastDataSentInSeconds

int getTimeSinceLastDataSentInSeconds()

getAvailWentBadTime

long getAvailWentBadTime()

getBytesUnavailable

long getBytesUnavailable()

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()