Class PEPeerStatsImpl

  • All Implemented Interfaces:
    PEPeerStats

    public class PEPeerStatsImpl
    extends java.lang.Object
    implements PEPeerStats
    • Field Detail

      • total_data_bytes_received

        private long total_data_bytes_received
      • total_protocol_bytes_received

        private long total_protocol_bytes_received
      • data_receive_speed

        private final Average data_receive_speed
      • protocol_receive_speed

        private final Average protocol_receive_speed
      • total_data_bytes_sent

        private long total_data_bytes_sent
      • total_protocol_bytes_sent

        private long total_protocol_bytes_sent
      • data_send_speed

        private final Average data_send_speed
      • protocol_send_speed

        private final Average protocol_send_speed
      • receive_speed_for_choking

        private final Average receive_speed_for_choking
      • estimated_download_speed

        private final Average estimated_download_speed
      • estimated_upload_speed

        private final Average estimated_upload_speed
      • total_bytes_discarded

        private long total_bytes_discarded
      • total_bytes_downloaded

        private long total_bytes_downloaded
      • disk_read_bytes

        private long disk_read_bytes
      • disk_read_count

        private int disk_read_count
      • disk_aggregated_read_count

        private int disk_aggregated_read_count
      • last_new_piece_time

        private long last_new_piece_time
    • Constructor Detail

      • PEPeerStatsImpl

        public PEPeerStatsImpl​(PEPeer _owner)
    • Method Detail

      • 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
      • 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