git-svn-id: svn://db.shs.com.ru/pip@190 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2016-04-15 13:00:46 +00:00
parent cde8f9b84c
commit 91a5221761
2 changed files with 9 additions and 9 deletions

View File

@@ -66,7 +66,7 @@ void PIDiagnostics::reset() {
void PIDiagnostics::received(int size, bool correct) {
lock();
Entry & e(history_send.front());
Entry & e(history_rec.front());
if (correct) {
e.cnt_ok++;
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();
int tcnt_recv = 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);
bytes_recv_sec = ullong(double(recv.bytes_ok) / itr);
bytes_send_sec = ullong(double(send.bytes_ok) / its);
immediate_freq = double(history_rec.back().cnt_ok) / hz;
// piCoutObj << disconn_ << interval() << history_send.size() << tcnt_send << count_send << send.cnt_ok;
// speedRecv = PIString::readableSize(ullong(double(history_rec.back().bytes_ok) / hz)) + "/s";
// speedSend = PIString::readableSize(ullong(double(history_send.back().bytes_ok) / hz)) + "/s";
immediate_freq = double(history_rec.front().cnt_ok) / hz;
piCoutObj << "tick" << recv.cnt_ok << send.cnt_ok;
// speedRecv = PIString::readableSize(ullong(double(history_rec.front().bytes_ok) / hz)) + "/s";
// speedSend = PIString::readableSize(ullong(double(history_send.front().bytes_ok) / hz)) + "/s";
speedRecv = PIString::readableSize(bytes_recv_sec) + "/s";
speedSend = PIString::readableSize(bytes_send_sec) + "/s";
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++;
}
e.empty = false;
//piCoutObj << hist.size() << cnt;
piCoutObj << hist.size() << cnt;
return e;
}

View File

@@ -189,14 +189,14 @@ private:
bool empty;
};
void tick(void * data, int delimiter);
void tick(void *, int);
Entry calcHistory(PIQueue<Entry> & hist, int & cnt);
void propertyChanged(const PIString &);
void changeDisconnectTimeout(float disct);
PIDiagnostics::Quality qual;
PIString speedRecv, speedSend;
float ifreq, immediate_freq, integral_freq;
float immediate_freq, integral_freq;
PIQueue<Entry> history_rec, history_send;
float disconn_;
ullong count_wrong, count_recv, count_send, bytes_wrong, bytes_recv, bytes_send;