]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From: "Andrew Humphrey" <ajh@paisley.its.unimelb.edu.au>
authorwessels <>
Sat, 1 Feb 1997 06:38:38 +0000 (06:38 +0000)
committerwessels <>
Sat, 1 Feb 1997 06:38:38 +0000 (06:38 +0000)
to ignore or flame at your leisure.  Anyway's here's a simple patch to add
a count of URLS rewritten to the redirector stuff, so that output from
the cache_object://localhost/stats/redirector looks like

src/redirect.cc

index fb0aebb445f6370ad2a14496e5bb4993736ed38a..20d50d63c73ea099a0ee8648a4d789cb421e08dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: redirect.cc,v 1.33 1997/01/23 18:31:23 wessels Exp $
+ * $Id: redirect.cc,v 1.34 1997/01/31 23:38:38 wessels Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Duane Wessels
@@ -62,6 +62,7 @@ static struct {
     int avg_svc_time;
     int queue_size;
     int use_hist[DefaultRedirectChildrenMax];
+    int rewrites[DefaultRedirectChildrenMax];
 } RedirectStats;
 
 
@@ -187,6 +188,8 @@ redirectHandleRead(int fd, redirector_t * redirector)
            fatal_dump("All redirectors have exited!");
        return 0;
     }
+    if (len != 1)
+       RedirectStats.rewrites[redirector->index]++;
     redirector->offset += len;
     redirector->inbuf[redirector->offset] = '\0';
     /* reschedule */
@@ -495,9 +498,10 @@ redirectStats(StoreEntry * sentry)
        NRedirectors);
     storeAppendPrintf(sentry, "{use histogram:}\n");
     for (k = 0; k < NRedirectors; k++) {
-       storeAppendPrintf(sentry, "{    redirector #%d: %d}\n",
+       storeAppendPrintf(sentry, "{    redirector #%d: %d (%d rewrites)}\n",
            k + 1,
-           RedirectStats.use_hist[k]);
+           RedirectStats.use_hist[k],
+           RedirectStats.rewrites[k]);
     }
     storeAppendPrintf(sentry, close_bracket);
 }