Package com.biglybt.pifimpl.local.peers
Class PeerStatsImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.peers.PeerStatsImpl
-
-
Field Summary
Fields Modifier and Type Field Description private PEPeerStats
delegate
private PEPeerManager
manager
private Peer
owner
private PeerManagerImpl
peer_manager
-
Constructor Summary
Constructors Constructor Description PeerStatsImpl(PeerManagerImpl _peer_manager, Peer _owner, PEPeerStats _delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
discarded(int bytes)
The given number of bytes received from the peer were discarded.PEPeerStats
getDelegate()
int
getDownloadAverage()
Get the the average bytes-per-second speed that we are receiving piece data from the peer.int
getDownloadRateLimit()
long
getOverallBytesRemaining()
int
getPermittedBytesToReceive()
For an external process receiving bytes on behalf of this peer this gives the current rate-limited number of bytes that can be received.int
getPermittedBytesToSend()
For an external process sending bytes on behalf of this peer this gives the current rate-limited number of bytes that can be sent.int
getReception()
Get the the longer-average bytes-per-second speed at which the peer is uploading data to us.int
getStatisticSentAverage()
Get the estimated total upload rate of the peer.long
getTimeSinceConnectionEstablished()
Get the amount of time that has elapsed since the connection with the peer has been established.int
getTotalAverage()
Get the estimated total download rate of the peer.long
getTotalDiscarded()
Get the total number of discarded bytes received from the peer.long
getTotalReceived()
Get the total number of data (payload) bytes received from the peer.long
getTotalSent()
Get the total number of data (payload) bytes sent to the peer.int
getUploadAverage()
Get the the average bytes-per-second speed that we are sending piece data to the peer.int
getUploadRateLimit()
void
permittedReceiveBytesUsed(int bytes)
void
permittedSendBytesUsed(int bytes)
void
received(int bytes)
The given number of data (payload) bytes have been sent to the peer.void
sent(int bytes)
The given number of data (payload) bytes have been received from the peer.void
setDownloadRateLimit(int bytes)
void
setUploadRateLimit(int bytes)
-
-
-
Field Detail
-
peer_manager
private PeerManagerImpl peer_manager
-
manager
private PEPeerManager manager
-
delegate
private PEPeerStats delegate
-
owner
private Peer owner
-
-
Constructor Detail
-
PeerStatsImpl
public PeerStatsImpl(PeerManagerImpl _peer_manager, Peer _owner, PEPeerStats _delegate)
-
-
Method Detail
-
getDelegate
public PEPeerStats getDelegate()
-
getDownloadAverage
public int getDownloadAverage()
Description copied from interface:PeerStats
Get the the average bytes-per-second speed that we are receiving piece data from the peer.- Specified by:
getDownloadAverage
in interfacePeerStats
- Returns:
- average speed.
-
getReception
public int getReception()
Description copied from interface:PeerStats
Get the the longer-average bytes-per-second speed at which the peer is uploading data to us.- Specified by:
getReception
in interfacePeerStats
- Returns:
- average speed
-
getUploadAverage
public int getUploadAverage()
Description copied from interface:PeerStats
Get the the average bytes-per-second speed that we are sending piece data to the peer.- Specified by:
getUploadAverage
in interfacePeerStats
- Returns:
- average speed.
-
getTotalAverage
public int getTotalAverage()
Description copied from interface:PeerStats
Get the estimated total download rate of the peer.- Specified by:
getTotalAverage
in interfacePeerStats
- Returns:
- estimated rate in bytes-per-second
-
getTotalDiscarded
public long getTotalDiscarded()
Description copied from interface:PeerStats
Get the total number of discarded bytes received from the peer.- Specified by:
getTotalDiscarded
in interfacePeerStats
- Returns:
- total discarded
-
getTotalSent
public long getTotalSent()
Description copied from interface:PeerStats
Get the total number of data (payload) bytes sent to the peer.- Specified by:
getTotalSent
in interfacePeerStats
- Returns:
- total
-
getTotalReceived
public long getTotalReceived()
Description copied from interface:PeerStats
Get the total number of data (payload) bytes received from the peer.- Specified by:
getTotalReceived
in interfacePeerStats
- Returns:
- total
-
getStatisticSentAverage
public int getStatisticSentAverage()
Description copied from interface:PeerStats
Get the estimated total upload rate of the peer.- Specified by:
getStatisticSentAverage
in interfacePeerStats
- Returns:
- estimated rate in bytes-per-second
-
getPermittedBytesToReceive
public int getPermittedBytesToReceive()
Description copied from interface:PeerStats
For an external process receiving bytes on behalf of this peer this gives the current rate-limited number of bytes that can be received. Update with actual send using 'permittedReceiveBytesUsed' below.- Specified by:
getPermittedBytesToReceive
in interfacePeerStats
- Returns:
-
permittedReceiveBytesUsed
public void permittedReceiveBytesUsed(int bytes)
- Specified by:
permittedReceiveBytesUsed
in interfacePeerStats
-
getPermittedBytesToSend
public int getPermittedBytesToSend()
Description copied from interface:PeerStats
For an external process sending bytes on behalf of this peer this gives the current rate-limited number of bytes that can be sent. Update with actual send using 'sent' below.- Specified by:
getPermittedBytesToSend
in interfacePeerStats
- Returns:
-
permittedSendBytesUsed
public void permittedSendBytesUsed(int bytes)
- Specified by:
permittedSendBytesUsed
in interfacePeerStats
-
received
public void received(int bytes)
Description copied from interface:PeerStats
The given number of data (payload) bytes have been sent to the peer. This number gets added to the total and is used to calculate the rate.Use this if you are talking to the peer outside of Azureus' API, and want your stats added into Azureus'
-
sent
public void sent(int bytes)
Description copied from interface:PeerStats
The given number of data (payload) bytes have been received from the peer. This number gets added to the total and is used to calculate the rate.Use this if you are talking to the peer outside of Azureus' API, and want your stats added into Azureus'
-
discarded
public void discarded(int bytes)
Description copied from interface:PeerStats
The given number of bytes received from the peer were discarded. This number gets added to the total and is used to calculate rates that include disgarded inforamtion.Use this if you are talking to the peer outside of Azureus' API, and want your stats added into Azureus'
-
getTimeSinceConnectionEstablished
public long getTimeSinceConnectionEstablished()
Description copied from interface:PeerStats
Get the amount of time that has elapsed since the connection with the peer has been established.- Specified by:
getTimeSinceConnectionEstablished
in interfacePeerStats
- Returns:
- Amount of time in ms.
-
getDownloadRateLimit
public int getDownloadRateLimit()
- Specified by:
getDownloadRateLimit
in interfacePeerStats
-
setDownloadRateLimit
public void setDownloadRateLimit(int bytes)
- Specified by:
setDownloadRateLimit
in interfacePeerStats
-
getUploadRateLimit
public int getUploadRateLimit()
- Specified by:
getUploadRateLimit
in interfacePeerStats
-
setUploadRateLimit
public void setUploadRateLimit(int bytes)
- Specified by:
setUploadRateLimit
in interfacePeerStats
-
getOverallBytesRemaining
public long getOverallBytesRemaining()
- Specified by:
getOverallBytesRemaining
in interfacePeerStats
- Returns:
-
-