- added statistics to logreader
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user