From: wessels <> Date: Thu, 3 Sep 1998 09:48:36 +0000 (+0000) Subject: comm_select # ready fd's histogram X-Git-Tag: SQUID_3_0_PRE1~2766 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26d6ee93172378042a6b3f4081c005653b2be7f2;p=thirdparty%2Fsquid.git comm_select # ready fd's histogram --- diff --git a/src/comm_select.cc b/src/comm_select.cc index 474934cb82..0d9b3b6646 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,7 +1,7 @@ /* - * $Id: comm_select.cc,v 1.6 1998/09/03 03:37:33 wessels Exp $ + * $Id: comm_select.cc,v 1.7 1998/09/03 03:48:39 wessels Exp $ * * DEBUG: section 5 Socket Functions * @@ -320,7 +320,8 @@ comm_poll(int msec) return COMM_ERROR; /* NOTREACHED */ } - debug(5, num ? 5 : 8) ("comm_poll: %d sockets ready\n", num); + debug(5, num ? 5 : 8) ("comm_poll: %d FDs ready\n", num); + statHistCount(&Counter.select_fds_hist, num); /* Check timeout handlers ONCE each second. */ if (squid_curtime > last_timeout) { last_timeout = squid_curtime; @@ -586,8 +587,9 @@ comm_select(int msec) } if (num < 0) continue; - debug(5, num ? 5 : 8) ("comm_select: %d sockets ready at %d\n", + debug(5, num ? 5 : 8) ("comm_select: %d FDs ready at %d\n", num, (int) squid_curtime); + statHistCount(&Counter.select_fds_hist, num); /* Check lifetime and timeout handlers ONCE each second. * Replaces brain-dead check every time through the loop! */ if (squid_curtime > last_timeout) { diff --git a/src/protos.h b/src/protos.h index 8edac3ad09..0d16e67714 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.259 1998/09/03 03:37:34 wessels Exp $ + * $Id: protos.h,v 1.260 1998/09/03 03:48:38 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -677,6 +677,7 @@ extern double statHistDeltaMedian(const StatHist * A, const StatHist * B); extern void statHistDump(const StatHist * H, StoreEntry * sentry, StatHistBinDumper bd); extern void statHistLogInit(StatHist * H, int capacity, double min, double max); extern void statHistEnumInit(StatHist * H, int last_enum); +extern void statHistIntInit(StatHist * H, int n); extern StatHistBinDumper statHistEnumDumper; extern StatHistBinDumper statHistIntDumper; diff --git a/src/stat.cc b/src/stat.cc index a5562ed695..67e62a7c79 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.282 1998/09/03 03:37:35 wessels Exp $ + * $Id: stat.cc,v 1.283 1998/09/03 03:48:36 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -748,6 +748,9 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours) f->select_fds > l->select_fds ? (f->select_time - l->select_time) / (f->select_fds - l->select_fds) : 0.0); + x = statHistDeltaMedian(&l->select_fds_hist, &f->select_fds_hist); + storeAppendPrintf(sentry, "median_select_fds = %f\n", x); + storeAppendPrintf(sentry, "cpu_time = %f seconds\n", ct); storeAppendPrintf(sentry, "wall_time = %f seconds\n", dt); storeAppendPrintf(sentry, "cpu_usage = %f%%\n", dpercent(ct, dt)); @@ -879,6 +882,7 @@ statCountersInitSpecial(StatCounters * C) statHistEnumInit(&C->cd.on_xition_count, CacheDigestHashFuncCount); statHistEnumInit(&C->comm_icp_incoming, INCOMING_ICP_MAX); statHistEnumInit(&C->comm_http_incoming, INCOMING_HTTP_MAX); + statHistIntInit(&C->select_fds_hist, SQUID_MAXFD); } /* add special cases here as they arrive */ @@ -897,6 +901,7 @@ statCountersClean(StatCounters * C) statHistClean(&C->cd.on_xition_count); statHistClean(&C->comm_icp_incoming); statHistClean(&C->comm_http_incoming); + statHistClean(&C->select_fds_hist); } /* add special cases here as they arrive */ @@ -921,6 +926,7 @@ statCountersCopy(StatCounters * dest, const StatCounters * orig) statHistCopy(&dest->cd.on_xition_count, &orig->cd.on_xition_count); statHistCopy(&dest->comm_icp_incoming, &orig->comm_icp_incoming); statHistCopy(&dest->comm_http_incoming, &orig->comm_http_incoming); + statHistCopy(&dest->select_fds_hist, &orig->select_fds_hist); } static void diff --git a/src/structs.h b/src/structs.h index 36cc1744ae..03b007ca21 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.215 1998/09/03 03:37:36 wessels Exp $ + * $Id: structs.h,v 1.216 1998/09/03 03:48:37 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -1392,6 +1392,7 @@ struct _StatCounters { struct timeval timestamp; StatHist comm_icp_incoming; StatHist comm_http_incoming; + StatHist select_fds_hist; }; /* per header statistics */