Class PeerStatsImpl
java.lang.Object
com.biglybt.pifimpl.local.peers.PeerStatsImpl
- All Implemented Interfaces:
PeerStats
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PEPeerStatsprivate final PEPeerManagerprivate final Peerprivate final PeerManagerImpl -
Constructor Summary
ConstructorsConstructorDescriptionPeerStatsImpl(PeerManagerImpl _peer_manager, Peer _owner, PEPeerStats _delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoiddiscarded(int bytes) The given number of bytes received from the peer were discarded.intGet the the average bytes-per-second speed that we are receiving piece data from the peer.intlonglongFor an external process receiving bytes on behalf of this peer this gives the current rate-limited number of bytes that can be received.longFor an external process sending bytes on behalf of this peer this gives the current rate-limited number of bytes that can be sent.intGet the the longer-average bytes-per-second speed at which the peer is uploading data to us.intGet the estimated total upload rate of the peer.longGet the amount of time that has elapsed since the connection with the peer has been established.intGet the estimated total download rate of the peer.longGet the total number of discarded bytes received from the peer.longGet the total number of data (payload) bytes received from the peer.longGet the total number of data (payload) bytes sent to the peer.intGet the the average bytes-per-second speed that we are sending piece data to the peer.intvoidpermittedReceiveBytesUsed(int bytes) voidpermittedSendBytesUsed(int bytes) voidreceived(long bytes) The given number of data (payload) bytes have been sent to the peer.voidsent(long bytes) The given number of data (payload) bytes have been received from the peer.voidsetDownloadRateLimit(int bytes) voidsetUploadRateLimit(int bytes)
-
Field Details
-
peer_manager
-
manager
-
delegate
-
owner
-
-
Constructor Details
-
PeerStatsImpl
-
-
Method Details
-
getDelegate
-
getDownloadAverage
public int getDownloadAverage()Description copied from interface:PeerStatsGet the the average bytes-per-second speed that we are receiving piece data from the peer.- Specified by:
getDownloadAveragein interfacePeerStats- Returns:
- average speed.
-
getReception
public int getReception()Description copied from interface:PeerStatsGet the the longer-average bytes-per-second speed at which the peer is uploading data to us.- Specified by:
getReceptionin interfacePeerStats- Returns:
- average speed
-
getUploadAverage
public int getUploadAverage()Description copied from interface:PeerStatsGet the the average bytes-per-second speed that we are sending piece data to the peer.- Specified by:
getUploadAveragein interfacePeerStats- Returns:
- average speed.
-
getTotalAverage
public int getTotalAverage()Description copied from interface:PeerStatsGet the estimated total download rate of the peer.- Specified by:
getTotalAveragein interfacePeerStats- Returns:
- estimated rate in bytes-per-second
-
getTotalDiscarded
public long getTotalDiscarded()Description copied from interface:PeerStatsGet the total number of discarded bytes received from the peer.- Specified by:
getTotalDiscardedin interfacePeerStats- Returns:
- total discarded
-
getTotalSent
public long getTotalSent()Description copied from interface:PeerStatsGet the total number of data (payload) bytes sent to the peer.- Specified by:
getTotalSentin interfacePeerStats- Returns:
- total
-
getTotalReceived
public long getTotalReceived()Description copied from interface:PeerStatsGet the total number of data (payload) bytes received from the peer.- Specified by:
getTotalReceivedin interfacePeerStats- Returns:
- total
-
getStatisticSentAverage
public int getStatisticSentAverage()Description copied from interface:PeerStatsGet the estimated total upload rate of the peer.- Specified by:
getStatisticSentAveragein interfacePeerStats- Returns:
- estimated rate in bytes-per-second
-
getPermittedBytesToReceive
public long getPermittedBytesToReceive()Description copied from interface:PeerStatsFor 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:
getPermittedBytesToReceivein interfacePeerStats- Returns:
-
permittedReceiveBytesUsed
public void permittedReceiveBytesUsed(int bytes) - Specified by:
permittedReceiveBytesUsedin interfacePeerStats
-
getPermittedBytesToSend
public long getPermittedBytesToSend()Description copied from interface:PeerStatsFor 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:
getPermittedBytesToSendin interfacePeerStats- Returns:
-
permittedSendBytesUsed
public void permittedSendBytesUsed(int bytes) - Specified by:
permittedSendBytesUsedin interfacePeerStats
-
received
public void received(long bytes) Description copied from interface:PeerStatsThe 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(long bytes) Description copied from interface:PeerStatsThe 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:PeerStatsThe 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:PeerStatsGet the amount of time that has elapsed since the connection with the peer has been established.- Specified by:
getTimeSinceConnectionEstablishedin interfacePeerStats- Returns:
- Amount of time in ms.
-
getDownloadRateLimit
public int getDownloadRateLimit()- Specified by:
getDownloadRateLimitin interfacePeerStats
-
setDownloadRateLimit
public void setDownloadRateLimit(int bytes) - Specified by:
setDownloadRateLimitin interfacePeerStats
-
getUploadRateLimit
public int getUploadRateLimit()- Specified by:
getUploadRateLimitin interfacePeerStats
-
setUploadRateLimit
public void setUploadRateLimit(int bytes) - Specified by:
setUploadRateLimitin interfacePeerStats- Parameters:
bytes-
-
getOverallBytesRemaining
public long getOverallBytesRemaining()- Specified by:
getOverallBytesRemainingin interfacePeerStats- Returns:
-