git-svn-id: svn://db.shs.com.ru/pip@190 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -66,7 +66,7 @@ void PIDiagnostics::reset() {
|
|||||||
|
|
||||||
void PIDiagnostics::received(int size, bool correct) {
|
void PIDiagnostics::received(int size, bool correct) {
|
||||||
lock();
|
lock();
|
||||||
Entry & e(history_send.front());
|
Entry & e(history_rec.front());
|
||||||
if (correct) {
|
if (correct) {
|
||||||
e.cnt_ok++;
|
e.cnt_ok++;
|
||||||
e.bytes_ok += size;
|
e.bytes_ok += size;
|
||||||
@@ -95,7 +95,7 @@ void PIDiagnostics::sended(int size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIDiagnostics::tick(void * data, int delimiter) {
|
void PIDiagnostics::tick(void * , int ) {
|
||||||
lock();
|
lock();
|
||||||
int tcnt_recv = 0;
|
int tcnt_recv = 0;
|
||||||
int tcnt_send = 0;
|
int tcnt_send = 0;
|
||||||
@@ -109,10 +109,10 @@ void PIDiagnostics::tick(void * data, int delimiter) {
|
|||||||
packets_send_sec = ullong(float(send.cnt_ok) / its);
|
packets_send_sec = ullong(float(send.cnt_ok) / its);
|
||||||
bytes_recv_sec = ullong(double(recv.bytes_ok) / itr);
|
bytes_recv_sec = ullong(double(recv.bytes_ok) / itr);
|
||||||
bytes_send_sec = ullong(double(send.bytes_ok) / its);
|
bytes_send_sec = ullong(double(send.bytes_ok) / its);
|
||||||
immediate_freq = double(history_rec.back().cnt_ok) / hz;
|
immediate_freq = double(history_rec.front().cnt_ok) / hz;
|
||||||
// piCoutObj << disconn_ << interval() << history_send.size() << tcnt_send << count_send << send.cnt_ok;
|
piCoutObj << "tick" << recv.cnt_ok << send.cnt_ok;
|
||||||
// speedRecv = PIString::readableSize(ullong(double(history_rec.back().bytes_ok) / hz)) + "/s";
|
// speedRecv = PIString::readableSize(ullong(double(history_rec.front().bytes_ok) / hz)) + "/s";
|
||||||
// speedSend = PIString::readableSize(ullong(double(history_send.back().bytes_ok) / hz)) + "/s";
|
// speedSend = PIString::readableSize(ullong(double(history_send.front().bytes_ok) / hz)) + "/s";
|
||||||
speedRecv = PIString::readableSize(bytes_recv_sec) + "/s";
|
speedRecv = PIString::readableSize(bytes_recv_sec) + "/s";
|
||||||
speedSend = PIString::readableSize(bytes_send_sec) + "/s";
|
speedSend = PIString::readableSize(bytes_send_sec) + "/s";
|
||||||
int arc = recv.cnt_ok + recv.cnt_fail;
|
int arc = recv.cnt_ok + recv.cnt_fail;
|
||||||
@@ -156,7 +156,7 @@ PIDiagnostics::Entry PIDiagnostics::calcHistory(PIQueue<Entry> & hist, int & cnt
|
|||||||
if (!hist[i].empty) cnt++;
|
if (!hist[i].empty) cnt++;
|
||||||
}
|
}
|
||||||
e.empty = false;
|
e.empty = false;
|
||||||
//piCoutObj << hist.size() << cnt;
|
piCoutObj << hist.size() << cnt;
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,14 +189,14 @@ private:
|
|||||||
bool empty;
|
bool empty;
|
||||||
};
|
};
|
||||||
|
|
||||||
void tick(void * data, int delimiter);
|
void tick(void *, int);
|
||||||
Entry calcHistory(PIQueue<Entry> & hist, int & cnt);
|
Entry calcHistory(PIQueue<Entry> & hist, int & cnt);
|
||||||
void propertyChanged(const PIString &);
|
void propertyChanged(const PIString &);
|
||||||
void changeDisconnectTimeout(float disct);
|
void changeDisconnectTimeout(float disct);
|
||||||
|
|
||||||
PIDiagnostics::Quality qual;
|
PIDiagnostics::Quality qual;
|
||||||
PIString speedRecv, speedSend;
|
PIString speedRecv, speedSend;
|
||||||
float ifreq, immediate_freq, integral_freq;
|
float immediate_freq, integral_freq;
|
||||||
PIQueue<Entry> history_rec, history_send;
|
PIQueue<Entry> history_rec, history_send;
|
||||||
float disconn_;
|
float disconn_;
|
||||||
ullong count_wrong, count_recv, count_send, bytes_wrong, bytes_recv, bytes_send;
|
ullong count_wrong, count_recv, count_send, bytes_wrong, bytes_recv, bytes_send;
|
||||||
|
|||||||
Reference in New Issue
Block a user