|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.core3.download.impl.DownloadManagerStatsImpl
public class DownloadManagerStatsImpl
Constructor Summary | |
---|---|
protected |
DownloadManagerStatsImpl(DownloadManagerImpl dm)
|
Method Summary | |
---|---|
protected void |
generateEvidence(IndentWriter writer)
|
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. |
java.lang.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 new_sent,
long new_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)
|
protected void |
saveSessionTotals()
|
void |
setCompleted(int _completed)
|
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 |
protected void |
setSavedDownloadedUploaded(long d,
long u)
|
void |
setShareRatio(int ratio)
|
void |
setSkippedFileStats(long skipped_file_set_size,
long skipped_but_downloaded)
|
void |
setUploadRateLimitBytesPerSecond(int max_rate_bps)
Set the max upload rate allowed for this download. |
protected void |
timerTick(int tick_count)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DownloadManagerStatsImpl(DownloadManagerImpl dm)
Method Detail |
---|
public long getDataReceiveRate()
getDataReceiveRate
in interface DownloadManagerStats
public long getProtocolReceiveRate()
getProtocolReceiveRate
in interface DownloadManagerStats
public long getDataSendRate()
getDataSendRate
in interface DownloadManagerStats
public long getProtocolSendRate()
getProtocolSendRate
in interface DownloadManagerStats
public long getPeakDataReceiveRate()
getPeakDataReceiveRate
in interface DownloadManagerStats
public long getPeakDataSendRate()
getPeakDataSendRate
in interface DownloadManagerStats
public long getSmoothedDataReceiveRate()
getSmoothedDataReceiveRate
in interface DownloadManagerStats
public long getSmoothedDataSendRate()
getSmoothedDataSendRate
in interface DownloadManagerStats
public long getETA()
DownloadManagerStats
getETA
in interface DownloadManagerStats
public long getSmoothedETA()
getSmoothedETA
in interface DownloadManagerStats
public int getCompleted()
DownloadManagerStats
Use getDownloadCompleted() if you wish to find out a torrents download completion level
getCompleted
in interface DownloadManagerStats
public void setCompleted(int _completed)
setCompleted
in interface DownloadManagerStats
public int getDownloadCompleted(boolean bLive)
DownloadManagerStats
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.
getDownloadCompleted
in interface DownloadManagerStats
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.
public void setDownloadCompletedBytes(long completedBytes)
setDownloadCompletedBytes
in interface DownloadManagerStats
public void recalcDownloadCompleteBytes()
recalcDownloadCompleteBytes
in interface DownloadManagerStats
public long getDownloadCompletedBytes()
DownloadManagerStats
Includes bytes downloaded for files marked as DND/Skipped
getDownloadCompletedBytes
in interface DownloadManagerStats
public java.lang.String getElapsedTime()
getElapsedTime
in interface DownloadManagerStats
public long getTimeStarted()
getTimeStarted
in interface DownloadManagerStats
public long getTimeStartedSeeding()
getTimeStartedSeeding
in interface DownloadManagerStats
public long getTotalDataBytesReceived()
DownloadManagerStats
getTotalDataBytesReceived
in interface DownloadManagerStats
public long getSessionDataBytesReceived()
getSessionDataBytesReceived
in interface DownloadManagerStats
public long getTotalGoodDataBytesReceived()
DownloadManagerStats
getTotalGoodDataBytesReceived
in interface DownloadManagerStats
public long getTotalProtocolBytesReceived()
getTotalProtocolBytesReceived
in interface DownloadManagerStats
public void resetTotalBytesSentReceived(long new_sent, long new_received)
DownloadManagerStats
resetTotalBytesSentReceived
in interface DownloadManagerStats
public long getTotalDataBytesSent()
DownloadManagerStats
getTotalDataBytesSent
in interface DownloadManagerStats
public long getTotalProtocolBytesSent()
getTotalProtocolBytesSent
in interface DownloadManagerStats
public long getSessionDataBytesSent()
getSessionDataBytesSent
in interface DownloadManagerStats
public void setRecentHistoryRetention(boolean required)
DownloadManagerStats
setRecentHistoryRetention
in interface DownloadManagerStats
public int[][] getRecentHistory()
DownloadManagerStats
getRecentHistory
in interface DownloadManagerStats
protected void timerTick(int tick_count)
public long getRemaining()
DownloadManagerStats
getRemaining
in interface DownloadManagerStats
public long getDiscarded()
getDiscarded
in interface DownloadManagerStats
public long getHashFailCount()
getHashFailCount
in interface DownloadManagerStats
public long getHashFailBytes()
getHashFailBytes
in interface DownloadManagerStats
public long getTotalAverage()
DownloadManagerStats
getTotalAverage
in interface DownloadManagerStats
public long getTotalAveragePerPeer()
DownloadManagerStats
getTotalAveragePerPeer
in interface DownloadManagerStats
public int getShareRatio()
DownloadManagerStats
getShareRatio
in interface DownloadManagerStats
public void setShareRatio(int ratio)
setShareRatio
in interface DownloadManagerStats
public long getSecondsDownloading()
getSecondsDownloading
in interface DownloadManagerStats
public long getSecondsOnlySeeding()
getSecondsOnlySeeding
in interface DownloadManagerStats
public float getAvailability()
getAvailability
in interface DownloadManagerStats
public long getBytesUnavailable()
getBytesUnavailable
in interface DownloadManagerStats
public int getUploadRateLimitBytesPerSecond()
DownloadManagerStats
getUploadRateLimitBytesPerSecond
in interface DownloadManagerStats
public void setUploadRateLimitBytesPerSecond(int max_rate_bps)
DownloadManagerStats
setUploadRateLimitBytesPerSecond
in interface DownloadManagerStats
max_rate_bps
- limit in bytes per second, 0 for unlimited, -1 for upload disabledpublic int getDownloadRateLimitBytesPerSecond()
DownloadManagerStats
getDownloadRateLimitBytesPerSecond
in interface DownloadManagerStats
public void setDownloadRateLimitBytesPerSecond(int max_rate_bps)
DownloadManagerStats
setDownloadRateLimitBytesPerSecond
in interface DownloadManagerStats
max_rate_bps
- limit in bytes per second, 0 for unlimited, -1 for download disabledpublic int getTimeSinceLastDataReceivedInSeconds()
getTimeSinceLastDataReceivedInSeconds
in interface DownloadManagerStats
public int getTimeSinceLastDataSentInSeconds()
getTimeSinceLastDataSentInSeconds
in interface DownloadManagerStats
public long getAvailWentBadTime()
getAvailWentBadTime
in interface DownloadManagerStats
protected void saveSessionTotals()
protected void setSavedDownloadedUploaded(long d, long u)
public void restoreSessionTotals(long _saved_data_bytes_downloaded, long _saved_data_bytes_uploaded, long _saved_discarded, long _saved_hashfails, long _saved_SecondsDownloading, long _saved_SecondsOnlySeeding)
restoreSessionTotals
in interface DownloadManagerStats
public void setSkippedFileStats(long skipped_file_set_size, long skipped_but_downloaded)
public long getRemainingExcludingDND()
getRemainingExcludingDND
in interface DownloadManagerStats
public long getSizeExcludingDND()
getSizeExcludingDND
in interface DownloadManagerStats
public int getPercentDoneExcludingDND()
getPercentDoneExcludingDND
in interface DownloadManagerStats
protected void generateEvidence(IndentWriter writer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |