From: wessels <> Date: Fri, 29 Jan 1999 06:51:25 +0000 (+0000) Subject: people complain about negative times in stats output: X-Git-Tag: SQUID_3_0_PRE1~2341 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4ae18d0caea623775f9bee858a0eff6e75b54b9;p=thirdparty%2Fsquid.git people complain about negative times in stats output: With squid 2.1.PATCH2, cachemgr's dnsserver statistics gives weird results for the unused daemons : # FD # Requests Flags Time Offset 1 9 1293 A 123.355 0 2 10 103 A 559.354 0 3 11 14 A 16580.994 0 4 12 0 A -1754703.782 0 5 13 0 A -1754703.782 0 --- diff --git a/src/helper.cc b/src/helper.cc index 87bb353c9a..2e4690fc28 100644 --- a/src/helper.cc +++ b/src/helper.cc @@ -114,6 +114,7 @@ helperStats(StoreEntry * sentry, helper * hlp) { helper_server *srv; dlink_node *link; + double tt; storeAppendPrintf(sentry, "number running: %d of %d\n", hlp->n_running, hlp->n_to_start); storeAppendPrintf(sentry, "requests sent: %d\n", @@ -134,6 +135,7 @@ helperStats(StoreEntry * sentry, helper * hlp) "Offset"); for (link = hlp->servers.head; link; link = link->next) { srv = link->data; + tt = 0.001 * tvSubMsec(srv->dispatch_time, current_time); storeAppendPrintf(sentry, "%7d\t%7d\t%11d\t%c%c%c%c\t%7.3f\t%7d\n", srv->index + 1, srv->rfd, @@ -142,7 +144,7 @@ helperStats(StoreEntry * sentry, helper * hlp) srv->flags.busy ? 'B' : ' ', srv->flags.closing ? 'C' : ' ', srv->flags.shutdown ? 'S' : ' ', - 0.001 * tvSubMsec(srv->dispatch_time, current_time), + tt < 0.0 ? 0.0 : tt, (int) srv->offset); } storeAppendPrintf(sentry, "\nFlags key:\n\n");