- do not allow logger to write more than once per period
- fixed bug in statistics.c
This commit is contained in:
10
statistics.c
10
statistics.c
@ -58,8 +58,8 @@ int StatisticsCommand(SConnection * con, SicsInterp * pSics, void *pData,
|
||||
|
||||
gettimeofday(&now, 0);
|
||||
dif = timeFloat(timeDif(lastStat, now));
|
||||
SCPrintf(con, eValue, "calls/s time[%] full[%] mean[ms] command");
|
||||
SCPrintf(con, eValue, "----------------------------------------------");
|
||||
SCPrintf(con, eLog, "calls/s time[%] full[%] mean[ms] command");
|
||||
SCPrintf(con, eLog, "----------------------------------------------");
|
||||
for (p = list; p != NULL; p = p->next) {
|
||||
if (dif > 0) {
|
||||
calls = p->cnt / dif;
|
||||
@ -71,7 +71,7 @@ int StatisticsCommand(SConnection * con, SicsInterp * pSics, void *pData,
|
||||
} else {
|
||||
dt = 0;
|
||||
}
|
||||
SCPrintf(con, eValue, "%7.1f %7.1f %7.1f %8.2f %s", calls,
|
||||
SCPrintf(con, eLog, "%7.1f %7.1f %7.1f %8.2f %s", calls,
|
||||
percent, full, dt, p->name);
|
||||
}
|
||||
}
|
||||
@ -81,8 +81,8 @@ int StatisticsCommand(SConnection * con, SicsInterp * pSics, void *pData,
|
||||
p->total.tv_sec = 0;
|
||||
p->total.tv_usec = 0;
|
||||
}
|
||||
SCPrintf(con, eValue, "----------------------------------------------");
|
||||
SCPrintf(con, eValue, "total time %.2f", dif);
|
||||
SCPrintf(con, eLog, "----------------------------------------------");
|
||||
SCPrintf(con, eLog, "total time %.2f", dif);
|
||||
lastStat = now;
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user