org.gudy.azureus2.plugins.download
Interface DownloadStats


public interface DownloadStats

Author:
parg This class gives access to various stats associated with the download

Field Summary
static int HEALTH_ERROR
          download in STATE_ERROR, see getStatus() for error
static int HEALTH_KO
          not connected to any peer and downloading
static int HEALTH_NO_REMOTE
           
static int HEALTH_NO_TRACKER
           
static int HEALTH_OK
           
static int HEALTH_STOPPED
           
 
Method Summary
 float getAvailability()
          Gives the currently seen availability of the torrent
 int getCheckingDoneInThousandNotation()
          if isChecking then returns completeness, 1000 -> 100%
 int getCompleted()
          returns a value between 0 and 1000 giving the completion status of the current download task (e.g. checking, downloading)
 long getDiscarded()
          Gives the number of bytes discarded
 long getDownloadAverage()
          Gives average number of bytes downloaded in last second
 int getDownloadCompleted(boolean bLive)
          Retrieve the level of download completion.
 java.lang.String getDownloadDirectory()
          Gives access to the directory into which the download is being saved
 long getDownloaded()
          Gives the number of bytes downloaded
 java.lang.String getElapsedTime()
          Gives the elapsed download time as a string
 java.lang.String getETA()
          Gives the estimated time to completion as a string
 long getHashFails()
          Gives the number of bytes thrown away due to piece hash check fails
 int getHealth()
          returns an indication of the health of the torrent
 long getRemaining()
          Gives number of bytes remaining
 long getSecondsDownloading()
           
 long getSecondsOnlySeeding()
           
 long getSecondsSinceLastDownload()
          Returns the number of seconds running time since data was downloaded, -1 if never
 long getSecondsSinceLastUpload()
          Returns the number of seconds running time since data was uploaded, -1 if never
 int getShareRatio()
          Gives the share ratio of the torrent in 1000ths (i.e. 1000 = share ratio of 1)
 java.lang.String getStatus()
          Returns an overall string representing the state of the download
 java.lang.String getStatus(boolean localised)
          Returns an overall string representing the state of the download *localised*
 java.lang.String getTargetFileOrDir()
          Gives access to the target file or directory that the download is being saved to
 long getTimeStarted()
          in ms since epoch
 long getTimeStartedSeeding()
           
 long getTotalAverage()
          Gives average number of bytes computed for torrent in last second
 java.lang.String getTrackerStatus()
          returns an general status string for the tracker
 long getUploadAverage()
          Gives average number of bytes uploaded in last second
 long getUploaded()
          Gives the number of bytes uploaded
 

Field Detail

HEALTH_STOPPED

static final int HEALTH_STOPPED
See Also:
Constant Field Values

HEALTH_NO_TRACKER

static final int HEALTH_NO_TRACKER
See Also:
Constant Field Values

HEALTH_NO_REMOTE

static final int HEALTH_NO_REMOTE
See Also:
Constant Field Values

HEALTH_OK

static final int HEALTH_OK
See Also:
Constant Field Values

HEALTH_KO

static final int HEALTH_KO
not connected to any peer and downloading

See Also:
Constant Field Values

HEALTH_ERROR

static final int HEALTH_ERROR
download in STATE_ERROR, see getStatus() for error

See Also:
Constant Field Values
Method Detail

getStatus

java.lang.String getStatus()
Returns an overall string representing the state of the download

Returns:
Since:
2.0.7.0

getStatus

java.lang.String getStatus(boolean localised)
Returns an overall string representing the state of the download *localised*

Returns:
Since:
2.3.0.7

getDownloadDirectory

java.lang.String getDownloadDirectory()
Gives access to the directory into which the download is being saved

Returns:
Since:
2.0.7.0

getTargetFileOrDir

java.lang.String getTargetFileOrDir()
Gives access to the target file or directory that the download is being saved to

Returns:
Since:
2.0.7.0

getTrackerStatus

java.lang.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. 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:

getDownloaded

long getDownloaded()
Gives the number of bytes downloaded

Returns:
Since:
2.0.7.0

getRemaining

long getRemaining()
Gives number of bytes remaining

Returns:

getUploaded

long getUploaded()
Gives the number of bytes uploaded

Returns:
Since:
2.0.7.0

getDiscarded

long getDiscarded()
Gives the number of bytes discarded

Returns:
Since:
2.0.7.0

getDownloadAverage

long getDownloadAverage()
Gives average number of bytes downloaded in last second

Returns:
Since:
2.0.7.0

getUploadAverage

long getUploadAverage()
Gives average number of bytes uploaded in last second

Returns:
Since:
2.0.7.0

getTotalAverage

long getTotalAverage()
Gives average number of bytes computed for torrent in last second

Returns:
Since:
2.0.7.0

getElapsedTime

java.lang.String getElapsedTime()
Gives the elapsed download time as a string

Returns:
Since:
2.0.7.0

getETA

java.lang.String getETA()
Gives the estimated time to completion as a string

Returns:
Since:
2.0.7.0

getHashFails

long getHashFails()
Gives the number of bytes thrown away due to piece hash check fails

Returns:
Since:
2.0.7.0

getShareRatio

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

Returns:
Since:
2.0.7.0

getTimeStarted

long getTimeStarted()
in ms since epoch

Since:
2.0.8.0

getTimeStartedSeeding

long getTimeStartedSeeding()

getAvailability

float getAvailability()
Gives the currently seen availability of the torrent

Returns:
Since:
2.0.8.2

getSecondsDownloading

long getSecondsDownloading()

getSecondsOnlySeeding

long getSecondsOnlySeeding()

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