- added statistics to logreader

This commit is contained in:
zolliker
2012-08-21 06:38:17 +00:00
parent 3e5773a446
commit fda64c46b5

View File

@ -253,6 +253,8 @@ static int LogReader(SConnection * pCon, SicsInterp * pSics, void *pData,
int idir;
char *colon;
static Statistics *stat;
Statistics *old;
/* argtolower(argc, argv); */
if (argc < 4)
@ -363,6 +365,10 @@ static int LogReader(SConnection * pCon, SicsInterp * pSics, void *pData,
loss = 0;
overflow = 0;
for (i = iarg; i < argc; i++) {
if (stat ==NULL) {
stat = StatisticsNew("loggervar");
}
old = StatisticsBegin(stat);
startim = from;
t = 0;
lastt = 0;
@ -545,6 +551,7 @@ static int LogReader(SConnection * pCon, SicsInterp * pSics, void *pData,
}
if (c.np < 0)
overflow = 1;
StatisticsEnd(old);
}
snprintf(line, sizeof line, "*%d %d\n", loss, overflow);
SCWrite(pCon, line, eWarning);