]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
*** empty log message ***
authorkostas <>
Sun, 22 Feb 1998 19:01:36 +0000 (19:01 +0000)
committerkostas <>
Sun, 22 Feb 1998 19:01:36 +0000 (19:01 +0000)
src/Makefile.in
src/stat.cc

index 4aa8b56eba617617d6fb64db4adb050092e4f8b9..e85f50488840b3cf48072a3d50bd10a555c8a086 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.123 1998/02/21 00:56:46 rousskov Exp $
+#  $Id: Makefile.in,v 1.124 1998/02/22 12:01:36 kostas Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -140,9 +140,9 @@ OBJS                = \
 
 SNMP_OBJS      = \
                snmp.o \
-                snmp_vars.o \
-                snmp_agent.o \
-                snmp_config.o 
+                snmp_oidlist.o \
+                snmp_agent.o  \
+               snmp_config.o
 
 ASYNC_OBJS     = \
                aiops.o \
index 2bb7480cf740d14b1040b9dd165d2188cf2759e4..6b8548f4bae67c405724e827d8923f9663bc6e1e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.202 1998/02/19 23:28:42 wessels Exp $
+ * $Id: stat.cc,v 1.203 1998/02/22 12:05:24 kostas Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -115,7 +115,7 @@ static void statAvgTick(void *notused);
 static void statAvgDump(StoreEntry *, int minutes);
 static void statCountersDump(StoreEntry * sentry);
 static void statCounterInit(StatCounters *);
-static void statLogHistInit(StatLogHist *, double, double);
+void statLogHistInit(StatLogHist *, double, double);
 static int statLogHistBin(StatLogHist *, double);
 static double statLogHistVal(StatLogHist *, double);
 static double statLogHistDeltaMedian(StatLogHist * A, StatLogHist * B);
@@ -137,7 +137,7 @@ static void info_get_mallstat(int, int, StoreEntry *);
  * An hour's worth, plus the 'current' counter
  */
 #define N_COUNT_HIST 61
-static StatCounters CountHist[N_COUNT_HIST];
+StatCounters CountHist[N_COUNT_HIST];
 static int NCountHist = 0;
 
 void
@@ -756,7 +756,7 @@ statAvg60min(StoreEntry * e)
     statAvgDump(e, 60);
 }
 
-static void
+void
 statLogHistInit(StatLogHist * H, double min, double max)
 {
     H->min = min;
@@ -773,7 +773,7 @@ statLogHistCount(StatLogHist * H, double val)
     H->bins[bin]++;
 }
 
-static double
+double
 statLogHistDeltaMedian(StatLogHist * A, StatLogHist * B)
 {
     StatLogHist D;
@@ -842,6 +842,35 @@ statLogHistVal(StatLogHist * H, double bin)
     return exp(bin / H->scale) + H->min - 1.0;
 }
 
+enum { HTTP_SVC, ICP_SVC, DNS_SVC };
+
+int 
+get_median_svc(int interval, int which)
+{
+    StatCounters *f;
+    StatCounters *l;
+    double x;
+
+    f = &CountHist[0];
+    l = &CountHist[interval];
+       assert(f);
+       assert(l);
+    switch (which) {
+    case HTTP_SVC:
+        x = statLogHistDeltaMedian(&l->client_http.svc_time, &f->client_http.svc_time);
+        break;
+    case ICP_SVC:
+        x = statLogHistDeltaMedian(&l->icp.svc_time, &f->icp.svc_time);
+        break;
+    case DNS_SVC:
+        x = statLogHistDeltaMedian(&l->dns.svc_time, &f->dns.svc_time);
+        break;
+    default:
+        debug(49,5)("get_median_val: unknown type.\n");
+        x=0;
+    }
+    return (int)x;
+}
 static void
 statLogHistDump(StoreEntry * sentry, StatLogHist * H)
 {