Interface DownloadManagerStats

All Known Implementing Classes:
DownloadManagerStatsImpl

public interface DownloadManagerStats
  • Method Details

    • 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) -1 if actually infinite (downloaded = 0, uploaded > 0 ), Integer.MAX_VALUE if massive
    • 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, 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
    • 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()
    • getFilePriorityStats

      int[] getFilePriorityStats()