Methods Summary |
---|
public void | dataBytesReceived(PEPeer peer, int length)
total_data_bytes_received += length;
data_receive_speed.addValue(length);
if ( length > 0 ){
last_data_received_seconds = (int)(SystemTime.getCurrentTime()/1000);
}
adapter.dataBytesReceived( peer, length );
|
public void | dataBytesSent(PEPeer peer, int length)
total_data_bytes_sent += length;
data_send_speed.addValue(length);
if ( length > 0 ){
last_data_sent_seconds = (int)(SystemTime.getCurrentTime()/1000);
}
adapter.dataBytesSent( peer, length );
|
public void | discarded(PEPeer peer, int length)
this.totalDiscarded += length;
adapter.discarded( peer, length );
|
public long | getDataReceiveRate()
return( data_receive_speed.getAverage());
|
public long | getDataSendRate()
return( data_send_speed.getAverage());
|
public long | getProtocolReceiveRate()
return protocol_receive_speed.getAverage();
|
public long | getProtocolSendRate()
return protocol_send_speed.getAverage();
|
public int | getTimeSinceLastDataReceivedInSeconds()
if ( last_data_received_seconds == 0 ){
return( -1 );
}
int now = (int)(SystemTime.getCurrentTime()/1000);
if ( now < last_data_received_seconds ){
last_data_received_seconds = now;
}
return( now - last_data_received_seconds );
|
public int | getTimeSinceLastDataSentInSeconds()
if ( last_data_sent_seconds == 0 ){
return( -1 );
}
int now = (int)(SystemTime.getCurrentTime()/1000);
if ( now < last_data_sent_seconds ){
last_data_sent_seconds = now;
}
return( now - last_data_sent_seconds );
|
public long | getTotalAverage()
return( overallSpeed.getAverage() + getDataReceiveRate() );
|
public long | getTotalDataBytesReceived()
return total_data_bytes_received;
|
public long | getTotalDataBytesSent()
return total_data_bytes_sent;
|
public long | getTotalDiscarded()
return( totalDiscarded );
|
public long | getTotalHashFailBytes()
return( hash_fail_bytes );
|
public long | getTotalProtocolBytesReceived()
return total_protocol_bytes_received;
|
public long | getTotalProtocolBytesSent()
return total_protocol_bytes_sent;
|
public void | hashFailed(int length)
hash_fail_bytes += length;
|
public void | haveNewPiece(int pieceLength)
overallSpeed.addValue(pieceLength);
|
public void | protocolBytesReceived(PEPeer peer, int length)
total_protocol_bytes_received += length;
protocol_receive_speed.addValue(length);
adapter.protocolBytesReceived( peer, length );
|
public void | protocolBytesSent(PEPeer peer, int length)
total_protocol_bytes_sent += length;
protocol_send_speed.addValue(length);
adapter.protocolBytesSent( peer, length );
|
public void | setTotalDiscarded(long total)
this.totalDiscarded = total;
|