From: wessels <> Date: Sat, 1 Feb 1997 06:38:38 +0000 (+0000) Subject: From: "Andrew Humphrey" X-Git-Tag: SQUID_3_0_PRE1~5155 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f06b30896b9baf1106fcfdb29a6e01e3ad1283e2;p=thirdparty%2Fsquid.git From: "Andrew Humphrey" 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 --- diff --git a/src/redirect.cc b/src/redirect.cc index fb0aebb445..20d50d63c7 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -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); }