--------------------- PatchSet 2693 Date: 2001/08/01 11:41:05 Author: rbcollins Branch: ntlm Tag: (none) Log: extra stats for stateful helpers Members: src/helper.c:1.1.1.3.12.29->1.1.1.3.12.30 src/structs.h:1.1.1.3.4.1.2.47->1.1.1.3.4.1.2.48 Index: squid/src/helper.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/helper.c,v retrieving revision 1.1.1.3.12.29 retrieving revision 1.1.1.3.12.30 diff -u -r1.1.1.3.12.29 -r1.1.1.3.12.30 --- squid/src/helper.c 31 Jul 2001 13:34:23 -0000 1.1.1.3.12.29 +++ squid/src/helper.c 1 Aug 2001 11:41:05 -0000 1.1.1.3.12.30 @@ -1,6 +1,6 @@ /* - * $Id: helper.c,v 1.1.1.3.12.29 2001/07/31 13:34:23 rbcollins Exp $ + * $Id: helper.c,v 1.1.1.3.12.30 2001/08/01 11:41:05 rbcollins Exp $ * * DEBUG: section 29 Helper process maintenance * AUTHOR: Harvest Derived? @@ -183,6 +183,10 @@ srv->flags.alive = 1; srv->flags.reserved = S_HELPER_FREE; srv->deferred_requests = 0; + srv->stats.deferbyfunc = 0; + srv->stats.deferbycb = 0; + srv->stats.submits = 0; + srv->stats.releases = 0; srv->index = k; srv->rfd = rfd; srv->wfd = wfd; @@ -263,7 +267,10 @@ debug (29,1) ("Submit with deferred helper '%d' state '%d' deferred count '%d'\n", lastserver, lastserver->flags.reserved, lastserver->deferred_requests); assert (!(lastserver->deferred_requests == 0 && lastserver->flags.reserved == S_HELPER_DEFERRED)); + /* TODO: remove this DEBUG ONLY ASSERT */ + assert (lastserver->flags.reserved != S_HELPER_RESERVED); if (lastserver->flags.reserved != S_HELPER_RESERVED) { + lastserver->stats.submits++; assert (lastserver->deferred_requests); lastserver->deferred_requests--; } @@ -324,6 +331,7 @@ rv->flags.reserved = S_HELPER_DEFERRED; rv->deferred_requests++; + rv->stats.deferbyfunc++; return rv; } @@ -363,6 +371,7 @@ /*decrease the number of 'waiting' clients that set the helper to be DEFERRED */ { debug (29,1) ("Release helper '%d' state '%d' deferred count '%d'\n", srv, srv->flags.reserved, srv->deferred_requests); + srv->stats.releases++; if (srv->deferred_requests > 0) { assert (srv->deferred_requests); srv->deferred_requests--; @@ -784,6 +793,7 @@ srv->flags.reserved = S_HELPER_DEFERRED; srv->deferred_requests++; + srv->stats.deferbycb++; debug(29, 5) ("StatefulHandleRead: reserving %s #%d for deferred requests.\n", hlp->id_name, srv->index + 1); break; default: Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.1.1.3.4.1.2.47 retrieving revision 1.1.1.3.4.1.2.48 diff -u -r1.1.1.3.4.1.2.47 -r1.1.1.3.4.1.2.48 --- squid/src/structs.h 1 Aug 2001 10:56:28 -0000 1.1.1.3.4.1.2.47 +++ squid/src/structs.h 1 Aug 2001 11:41:05 -0000 1.1.1.3.4.1.2.48 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.1.1.3.4.1.2.47 2001/08/01 10:56:28 rbcollins Exp $ + * $Id: structs.h,v 1.1.1.3.4.1.2.48 2001/08/01 11:41:05 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -2052,6 +2052,10 @@ } flags; struct { int uses; + int submits; + int releases; + int deferbyfunc; + int deferbycb; } stats; size_t deferred_requests; /* current number of deferred requests */ void *data; /* State data used by the calling routines */