]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
comm_select # ready fd's histogram
authorwessels <>
Thu, 3 Sep 1998 09:48:36 +0000 (09:48 +0000)
committerwessels <>
Thu, 3 Sep 1998 09:48:36 +0000 (09:48 +0000)
src/comm_select.cc
src/protos.h
src/stat.cc
src/structs.h

index 474934cb827336d55a37daf4982944e3e1302761..0d9b3b6646ebc22fd00cd372e5abd8e17e534ffe 100644 (file)
@@ -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) {
index 8edac3ad09cc124df4d321e1dfc3f2d5c56c950d..0d16e67714ec0a28df17bafc3045c223686ea6e7 100644 (file)
@@ -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;
 
index a5562ed6955fe56f3f46e22f467a0954361ad80d..67e62a7c79d27c354607cb7a4c7daf58e0b9ec8d 100644 (file)
@@ -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
index 36cc1744ae3a896b9cedd24c5c1c7e73e96ccb66..03b007ca2171e722b99c81d4a4f252d10c7268f7 100644 (file)
@@ -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 */