org.gudy.azureus2.core3.peer.impl
Class PEPeerStatsImpl

java.lang.Object
  extended by org.gudy.azureus2.core3.peer.impl.PEPeerStatsImpl
All Implemented Interfaces:
PEPeerStats

public class PEPeerStatsImpl
extends Object
implements PEPeerStats


Constructor Summary
PEPeerStatsImpl(PEPeer _owner)
           
 
Method Summary
 void bytesDiscarded(int num_bytes)
          The given number of bytes received from the peer were discarded.
 void dataBytesReceived(int num_bytes)
          The given number of data (payload) bytes have been received from the peer.
 void dataBytesSent(int num_bytes)
          The given number of data (payload) bytes have been sent to the peer.
 void diskReadComplete(long bytes)
          Disk access stats methods
 int getAggregatedDiskReadCount()
           
 long getDataReceiveRate()
          Get the the average bytes-per-second speed that we are receiving piece data from the peer.
 long getDataSendRate()
          Get the the average bytes-per-second speed that we are sending piece data to the peer.
 int getDownloadRateLimitBytesPerSecond()
           
 long getEstimatedDownloadRateOfPeer()
          Get the estimated total download rate of the peer.
 long getEstimatedSecondsToCompletion()
          0 if complete Long.MaxValue if infinite
 long getEstimatedUploadRateOfPeer()
          Get the estimated total upload rate of the peer.
 PEPeer getPeer()
           
 int getPermittedBytesToReceive()
           
 int getPermittedBytesToSend()
           
 long getProtocolReceiveRate()
          Get the the average bytes-per-second speed that we are receiving protocol messages from the peer.
 long getProtocolSendRate()
          Get the the average bytes-per-second speed that we are sending protocol messages to the peer.
 long getSmoothDataReceiveRate()
          Get the the longer-average bytes-per-second speed at which the peer is uploading data to us.
 long getTotalBytesDiscarded()
          Get the total number of discarded bytes received from the peer.
 long getTotalBytesDownloadedByPeer()
          Get the number of bytes downloaded in total by this peer (includes data downloaded from all other peers).
 long getTotalDataBytesReceived()
          Get the total number of data (payload) bytes received from the peer.
 long getTotalDataBytesSent()
          Get the total number of data (payload) bytes sent to the peer.
 long getTotalDiskReadBytes()
           
 int getTotalDiskReadCount()
           
 long getTotalProtocolBytesReceived()
          Get the total number of protocol (overhead) bytes received from the peer.
 long getTotalProtocolBytesSent()
          Get the total number of protocol (overhead) bytes sent to the peer.
 int getUploadRateLimitBytesPerSecond()
           
 void hasNewPiece(int piece_size)
          The peer has completed a piece of the given byte size.
 void permittedReceiveBytesUsed(int num)
           
 void permittedSendBytesUsed(int num)
           
 void protocolBytesReceived(int num_bytes)
          The given number of protocol (overhead) bytes have been received from the peer.
 void protocolBytesSent(int num_bytes)
          The given number of protocol (overhead) bytes have been sent to the peer.
 void setDownloadRateLimitBytesPerSecond(int bytes)
           
 void setPeer(PEPeer peer)
           
 void setUploadRateLimitBytesPerSecond(int bytes)
           
 void statisticalSentPiece(int piece_size)
          The peer has statistically sent a piecce of the given byte size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PEPeerStatsImpl

public PEPeerStatsImpl(PEPeer _owner)
Method Detail

getPeer

public PEPeer getPeer()
Specified by:
getPeer in interface PEPeerStats

setPeer

public void setPeer(PEPeer peer)
Specified by:
setPeer in interface PEPeerStats

dataBytesSent

public void dataBytesSent(int num_bytes)
Description copied from interface: PEPeerStats
The given number of data (payload) bytes have been sent to the peer.

Specified by:
dataBytesSent in interface PEPeerStats

protocolBytesSent

public void protocolBytesSent(int num_bytes)
Description copied from interface: PEPeerStats
The given number of protocol (overhead) bytes have been sent to the peer.

Specified by:
protocolBytesSent in interface PEPeerStats

dataBytesReceived

public void dataBytesReceived(int num_bytes)
Description copied from interface: PEPeerStats
The given number of data (payload) bytes have been received from the peer.

Specified by:
dataBytesReceived in interface PEPeerStats

protocolBytesReceived

public void protocolBytesReceived(int num_bytes)
Description copied from interface: PEPeerStats
The given number of protocol (overhead) bytes have been received from the peer.

Specified by:
protocolBytesReceived in interface PEPeerStats

bytesDiscarded

public void bytesDiscarded(int num_bytes)
Description copied from interface: PEPeerStats
The given number of bytes received from the peer were discarded.

Specified by:
bytesDiscarded in interface PEPeerStats

hasNewPiece

public void hasNewPiece(int piece_size)
Description copied from interface: PEPeerStats
The peer has completed a piece of the given byte size.

Specified by:
hasNewPiece in interface PEPeerStats

getEstimatedSecondsToCompletion

public long getEstimatedSecondsToCompletion()
0 if complete Long.MaxValue if infinite

Specified by:
getEstimatedSecondsToCompletion in interface PEPeerStats

statisticalSentPiece

public void statisticalSentPiece(int piece_size)
Description copied from interface: PEPeerStats
The peer has statistically sent a piecce of the given byte size.

Specified by:
statisticalSentPiece in interface PEPeerStats

getDataReceiveRate

public long getDataReceiveRate()
Description copied from interface: PEPeerStats
Get the the average bytes-per-second speed that we are receiving piece data from the peer.

Specified by:
getDataReceiveRate in interface PEPeerStats
Returns:
average speed.

getProtocolReceiveRate

public long getProtocolReceiveRate()
Description copied from interface: PEPeerStats
Get the the average bytes-per-second speed that we are receiving protocol messages from the peer.

Specified by:
getProtocolReceiveRate in interface PEPeerStats
Returns:
average speed.

getDataSendRate

public long getDataSendRate()
Description copied from interface: PEPeerStats
Get the the average bytes-per-second speed that we are sending piece data to the peer.

Specified by:
getDataSendRate in interface PEPeerStats
Returns:
average speed.

getProtocolSendRate

public long getProtocolSendRate()
Description copied from interface: PEPeerStats
Get the the average bytes-per-second speed that we are sending protocol messages to the peer.

Specified by:
getProtocolSendRate in interface PEPeerStats
Returns:
average speed.

getSmoothDataReceiveRate

public long getSmoothDataReceiveRate()
Description copied from interface: PEPeerStats
Get the the longer-average bytes-per-second speed at which the peer is uploading data to us.

Specified by:
getSmoothDataReceiveRate in interface PEPeerStats
Returns:
average speed

getTotalBytesDiscarded

public long getTotalBytesDiscarded()
Description copied from interface: PEPeerStats
Get the total number of discarded bytes received from the peer.

Specified by:
getTotalBytesDiscarded in interface PEPeerStats
Returns:
total discarded

getTotalBytesDownloadedByPeer

public long getTotalBytesDownloadedByPeer()
Description copied from interface: PEPeerStats
Get the number of bytes downloaded in total by this peer (includes data downloaded from all other peers).

Specified by:
getTotalBytesDownloadedByPeer in interface PEPeerStats
Returns:
total download bytes done

getEstimatedDownloadRateOfPeer

public long getEstimatedDownloadRateOfPeer()
Description copied from interface: PEPeerStats
Get the estimated total download rate of the peer.

Specified by:
getEstimatedDownloadRateOfPeer in interface PEPeerStats
Returns:
estimated rate in bytes-per-second

getEstimatedUploadRateOfPeer

public long getEstimatedUploadRateOfPeer()
Description copied from interface: PEPeerStats
Get the estimated total upload rate of the peer.

Specified by:
getEstimatedUploadRateOfPeer in interface PEPeerStats
Returns:
estimated rate in bytes-per-second

getTotalDataBytesReceived

public long getTotalDataBytesReceived()
Description copied from interface: PEPeerStats
Get the total number of data (payload) bytes received from the peer.

Specified by:
getTotalDataBytesReceived in interface PEPeerStats
Returns:
total

getTotalProtocolBytesReceived

public long getTotalProtocolBytesReceived()
Description copied from interface: PEPeerStats
Get the total number of protocol (overhead) bytes received from the peer.

Specified by:
getTotalProtocolBytesReceived in interface PEPeerStats
Returns:
total

getTotalDataBytesSent

public long getTotalDataBytesSent()
Description copied from interface: PEPeerStats
Get the total number of data (payload) bytes sent to the peer.

Specified by:
getTotalDataBytesSent in interface PEPeerStats
Returns:
total

getTotalProtocolBytesSent

public long getTotalProtocolBytesSent()
Description copied from interface: PEPeerStats
Get the total number of protocol (overhead) bytes sent to the peer.

Specified by:
getTotalProtocolBytesSent in interface PEPeerStats
Returns:
total

diskReadComplete

public void diskReadComplete(long bytes)
Description copied from interface: PEPeerStats
Disk access stats methods

Specified by:
diskReadComplete in interface PEPeerStats

getTotalDiskReadCount

public int getTotalDiskReadCount()
Specified by:
getTotalDiskReadCount in interface PEPeerStats

getAggregatedDiskReadCount

public int getAggregatedDiskReadCount()
Specified by:
getAggregatedDiskReadCount in interface PEPeerStats

getTotalDiskReadBytes

public long getTotalDiskReadBytes()
Specified by:
getTotalDiskReadBytes in interface PEPeerStats

setUploadRateLimitBytesPerSecond

public void setUploadRateLimitBytesPerSecond(int bytes)
Specified by:
setUploadRateLimitBytesPerSecond in interface PEPeerStats

setDownloadRateLimitBytesPerSecond

public void setDownloadRateLimitBytesPerSecond(int bytes)
Specified by:
setDownloadRateLimitBytesPerSecond in interface PEPeerStats

getUploadRateLimitBytesPerSecond

public int getUploadRateLimitBytesPerSecond()
Specified by:
getUploadRateLimitBytesPerSecond in interface PEPeerStats

getDownloadRateLimitBytesPerSecond

public int getDownloadRateLimitBytesPerSecond()
Specified by:
getDownloadRateLimitBytesPerSecond in interface PEPeerStats

getPermittedBytesToSend

public int getPermittedBytesToSend()
Specified by:
getPermittedBytesToSend in interface PEPeerStats

permittedSendBytesUsed

public void permittedSendBytesUsed(int num)
Specified by:
permittedSendBytesUsed in interface PEPeerStats

getPermittedBytesToReceive

public int getPermittedBytesToReceive()
Specified by:
getPermittedBytesToReceive in interface PEPeerStats

permittedReceiveBytesUsed

public void permittedReceiveBytesUsed(int num)
Specified by:
permittedReceiveBytesUsed in interface PEPeerStats