PSI UPDATE

r1724 | ffr | 2007-03-27 07:56:13 +1000 (Tue, 27 Mar 2007) | 2 lines
This commit is contained in:
Ferdi Franceschini
2007-03-27 07:56:13 +10:00
committed by Douglas Clowes
parent cd0de991b4
commit 6921d0426c
47 changed files with 569 additions and 648 deletions

View File

@@ -47,14 +47,15 @@ int StatisticsCommand(SConnection *con, SicsInterp *pSics, void *pData,
int argc, char *argv[]) {
Statistics *p;
tv_t now;
double dif, percent, full, dt;
double dif, percent, full, dt, calls;
gettimeofday(&now, 0);
dif = timeFloat(timeDif(lastStat, now));
SCPrintf(con, eStatus, " calls time[%] full[%] mean[ms] command");
SCPrintf(con, eStatus, "calls/s time[%] full[%] mean[ms] command");
SCPrintf(con, eStatus, "----------------------------------------------");
for (p = list; p != NULL; p = p->next) {
if (dif > 0) {
calls = p->cnt / dif;
percent = timeFloat(p->tim) * 100 / dif;
full = timeFloat(p->total) * 100 / dif;
if (full > 0 || percent > 0) {
@@ -63,7 +64,7 @@ int StatisticsCommand(SConnection *con, SicsInterp *pSics, void *pData,
} else {
dt = 0;
}
SCPrintf(con, eStatus, "%7ld %7.1f %7.1f %8.2f %s", p->cnt,
SCPrintf(con, eStatus, "%7.1f %7.1f %7.1f %8.2f %s", calls,
percent, full, dt, p->name);
}
}
@@ -73,6 +74,8 @@ int StatisticsCommand(SConnection *con, SicsInterp *pSics, void *pData,
p->total.tv_sec = 0;
p->total.tv_usec = 0;
}
SCPrintf(con, eStatus, "----------------------------------------------");
SCPrintf(con, eStatus, "total time %.2f", dif);
lastStat = now;
return 1;
}