|
SASC
DVBSoftCAM
|
Inheritance diagram for cLogStats:Public Member Functions | |
| cLogStats (void) | |
| ~cLogStats () | |
| void | Count (void) |
| cLogStats (void) | |
| ~cLogStats () | |
| void | Count (void) |
Protected Member Functions | |
| virtual void | Action (void) |
| virtual void | Action (void) |
| cLogStats::cLogStats | ( | void | ) |
| cLogStats::~cLogStats | ( | ) |
| cLogStats::cLogStats | ( | void | ) |
| cLogStats::~cLogStats | ( | ) |
| void cLogStats::Action | ( | void | ) | [protected, virtual] |
A derived cThread class must implement the code it wants to execute as a separate thread in this function. If this is a loop, it must check Running() repeatedly to see whether it's time to stop.
Implements cThread.
Definition at line 135 of file cam.c.
References AVR1, AVR2, AVR3, COUNTS, cTimeMs::Elapsed(), i, L_CORE_AUSTATS, LBEND, LBPUT, LBSTART, REPORT, cThread::Running(), SAMPLE, cTimeMs::Set(), and cCondWait::SleepMs().
{
while(Running()) {
cCondWait::SleepMs(50);
if(sTime.Elapsed()>SAMPLE) {
sCounts[sIdx][0]=sCount; sCount=0;
sCounts[sIdx][1]=sTime.Elapsed(); sTime.Set();
if(++sIdx >= COUNTS) sIdx=0;
}
if(repTime.Elapsed()>REPORT) {
repTime.Set();
if(sCounts[(sIdx+COUNTS-1)%COUNTS][0]>0) {
LBSTART(L_CORE_AUSTATS);
LBPUT("EMM packet load average (%d/%d/%dmin)",AVR1/60000,AVR2/60000,AVR3/60000);
int s=0, t=0;
for(int i=1; i<=COUNTS; i++) {
s+=sCounts[(sIdx+COUNTS-i)%COUNTS][0];
t+=sCounts[(sIdx+COUNTS-i)%COUNTS][1];
if(i==(AVR1/SAMPLE) || i==(AVR2/SAMPLE) || i==(AVR3/SAMPLE))
LBPUT(" %4d",(int)((float)s/(float)t*1000.0));
}
LBPUT(" pks/s");
LBEND();
}
}
}
}
| virtual void cLogStats::Action | ( | void | ) | [protected, virtual] |
| void cLogStats::Count | ( | void | ) |
| void cLogStats::Count | ( | void | ) |