PIDiagnostics
git-svn-id: svn://db.shs.com.ru/pip@132 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -50,7 +50,7 @@ void PIDiagnostics::reset() {
|
||||
speedIn = speedOut = PIString::readableSize(0) + "/s";
|
||||
ifreq = immediate_freq = integral_freq = 0.f;
|
||||
cur_pckt = rec_once = 0;
|
||||
wrong_count = receive_count = send_count = 0;
|
||||
wrong_count = receive_count = send_count = wrong_bytes = receive_bytes = send_bytes = 0;
|
||||
packets_in_sec = packets_out_sec = bytes_in_sec = bytes_out_sec = 0;
|
||||
unlock();
|
||||
}
|
||||
@@ -65,9 +65,11 @@ void PIDiagnostics::received(int size, bool correct) {
|
||||
if (el > 0.f) immediate_freq = ifreq = 1.f / el;
|
||||
else immediate_freq = ifreq = 0.f;
|
||||
receive_count++;
|
||||
receive_bytes += size;
|
||||
} else {
|
||||
immediate_freq = ifreq = 0.f;
|
||||
wrong_count++;
|
||||
wrong_bytes += size;
|
||||
}
|
||||
addToHistory(history_rec, size, correct);
|
||||
unlock();
|
||||
@@ -77,6 +79,7 @@ void PIDiagnostics::received(int size, bool correct) {
|
||||
void PIDiagnostics::sended(int size) {
|
||||
lock();
|
||||
send_count++;
|
||||
send_bytes += size;
|
||||
addToHistory(history_send, size);
|
||||
unlock();
|
||||
}
|
||||
|
||||
@@ -72,6 +72,15 @@ public:
|
||||
//! Returns sended bytes per second
|
||||
ullong sendBytesPerSec() const {return bytes_out_sec;}
|
||||
|
||||
//! Returns overall correct received bytes
|
||||
ullong receiveBytes() const {return receive_bytes;}
|
||||
|
||||
//! Returns overall wrong received bytes
|
||||
ullong wrongBytes() const {return wrong_bytes;}
|
||||
|
||||
//! Returns overall sended bytes
|
||||
ullong sendBytes() const {return send_bytes;}
|
||||
|
||||
//! Returns overall correct received packets count
|
||||
ullong receiveCount() const {return receive_count;}
|
||||
|
||||
@@ -109,6 +118,15 @@ public:
|
||||
//! Returns sended bytes per second pointer. Useful for output to PIConsole
|
||||
const ullong * sendBytesPerSec_ptr() const {return &bytes_out_sec;}
|
||||
|
||||
//! Returns overall correct received bytes pointer. Useful for output to PIConsole
|
||||
const ullong * receiveBytes_ptr() const {return &receive_bytes;}
|
||||
|
||||
//! Returns overall wrong received bytes pointer. Useful for output to PIConsole
|
||||
const ullong * wrongBytes_ptr() const {return &wrong_bytes;}
|
||||
|
||||
//! Returns overall sended bytes pointer. Useful for output to PIConsole
|
||||
const ullong * sendBytes_ptr() const {return &send_bytes;}
|
||||
|
||||
//! Returns overall correct received packets count pointer. Useful for output to PIConsole
|
||||
const ullong * receiveCount_ptr() const {return &receive_count;}
|
||||
|
||||
@@ -183,7 +201,7 @@ private:
|
||||
PISystemTime disconn_st;
|
||||
PITimeMeasurer tm;
|
||||
char cur_pckt, rec_once;
|
||||
ullong wrong_count, receive_count, send_count;
|
||||
ullong wrong_count, receive_count, send_count, wrong_bytes, receive_bytes, send_bytes;
|
||||
ullong packets_in_sec, packets_out_sec, bytes_in_sec, bytes_out_sec;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user