public final class TorrentStats
extends java.lang.Object
SessionManager.
The call to SessionManager#postTorrentUpdates() is done approximately
every second. This class holds a time series per metric and a time series for
the sampling time.
| Modifier and Type | Class and Description |
|---|---|
static class |
TorrentStats.SeriesMetric |
| Constructor and Description |
|---|
TorrentStats(Sha1Hash infoHash,
int maxSamples) |
| Modifier and Type | Method and Description |
|---|---|
long |
allTimeDownload()
This is the accumulated download payload byte counters.
|
long |
allTimeUpload()
This is the accumulated upload payload byte counter.
|
int |
downloadPayloadRate()
The total transfer rate of payload only, not counting protocol chatter.
|
int |
downloadRate()
The total rates for all peers for this torrent.
|
boolean |
isFinished()
Returns
true if all pieces that have a
priority > 0 are downloaded. |
boolean |
isPaused()
set to true if the torrent is paused and false otherwise.
|
boolean |
isSeeding()
true if all pieces have been downloaded.
|
boolean |
isSequentialDownload()
true when the torrent is in sequential download mode.
|
long |
last(TorrentStats.SeriesMetric metric) |
int |
listPeers()
The number of seeds in our peer list and the total number of peers (including seeds).
|
int |
listSeeds()
The number of seeds in our peer list and the total number of peers (including seeds).
|
int |
maxSamples() |
boolean |
needSaveResume()
true if this torrent has unsaved changes
to its download state and statistics since the last resume data
was saved.
|
int |
numConnections()
Returns the number of peer connections this torrent has,
including half-open connections that hasn't completed the
bittorrent handshake yet.
|
int |
numPeers()
The number of peers this torrent currently is connected to.
|
int |
numPieces()
Returns the number of pieces that has been downloaded so you don't have
to count yourself.
|
int |
numSeeds()
The number of peers that are seeding that this client is currently connected to.
|
float |
progress()
A value in the range [0, 1], that represents the progress of the torrent's
current task.
|
int |
progressPpm()
progress parts per million (progress * 1000000) when disabling
floating point operations, this is the only option to query progress
|
IntSeries |
series(TorrentStats.SeriesMetric metric) |
TorrentStatus.State |
state()
The main state the torrent is in.
|
long |
totalDone()
The total number of bytes of the file(s) that we have.
|
long |
totalDownload()
The number of bytes downloaded and uploaded to all peers, accumulated, this session
only.
|
long |
totalPayloadDownload()
Counts the amount of bytes received this session, but only
the actual payload data (i.e the interesting data), these counters
ignore any protocol overhead.
|
long |
totalPayloadUpload()
Counts the amount of bytes send this session, but only
the actual payload data (i.e the interesting data), these counters
ignore any protocol overhead.
|
long |
totalUpload()
The number of bytes downloaded and uploaded to all peers, accumulated, this session
only.
|
long |
totalWanted()
The total number of bytes we want to download.
|
long |
totalWantedDone()
The number of bytes we have downloaded, only counting the pieces that we actually want
to download.
|
void |
update(TorrentStatus status) |
int |
uploadPayloadRate()
The total transfer rate of payload only, not counting protocol chatter.
|
int |
uploadRate()
The total rates for all peers for this torrent.
|
public TorrentStats(Sha1Hash infoHash, int maxSamples)
public int maxSamples()
public IntSeries series(TorrentStats.SeriesMetric metric)
public long last(TorrentStats.SeriesMetric metric)
public long totalDownload()
public long totalUpload()
public long totalPayloadDownload()
public long totalPayloadUpload()
public long totalDone()
public long totalWantedDone()
public long totalWanted()
public long allTimeUpload()
public long allTimeDownload()
public float progress()
public int progressPpm()
reflects the same value as ``progress``, but instead in a range [0, 1000000] (ppm = parts per million). When floating point operations are disabled, this is the only alternative to the floating point value in.
public int downloadRate()
public int uploadRate()
public int downloadPayloadRate()
public int uploadPayloadRate()
public int numSeeds()
public int numPeers()
public int listSeeds()
public int listPeers()
public int numPieces()
public int numConnections()
This is always >= num_peers.
public TorrentStatus.State state()
public boolean needSaveResume()
public boolean isPaused()
public boolean isSequentialDownload()
public boolean isSeeding()
public boolean isFinished()
true if all pieces that have a
priority > 0 are downloaded. There is
only a distinction between finished and seeding if some pieces or
files have been set to priority 0, i.e. are not downloaded.true if all pieces that have a priority > 0 are downloaded.public void update(TorrentStatus status)