From: wessels <> Date: Sat, 9 Aug 1997 11:42:31 +0000 (+0000) Subject: instrumented persistent connection counter histogram X-Git-Tag: SQUID_3_0_PRE1~4842 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6605655c8b687758b339fdbcd95f61889236ffc3;p=thirdparty%2Fsquid.git instrumented persistent connection counter histogram --- diff --git a/ChangeLog b/ChangeLog index 5e33e03650..dea9b843d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ - Simpler cacheobj implementation. + - persistent connection histogram Changes to squid-1.2.alpha5 (): diff --git a/src/enums.h b/src/enums.h index 5c0681a0ff..b5f73d5b90 100644 --- a/src/enums.h +++ b/src/enums.h @@ -145,6 +145,7 @@ typedef enum { MGR_VM_OBJECTS, MGR_STOREDIR, MGR_CBDATA, + MGR_PCONN, MGR_MAX } objcache_op; diff --git a/src/main.cc b/src/main.cc index 1ee1d33396..c41e87b73d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.170 1997/07/28 06:40:59 wessels Exp $ + * $Id: main.cc,v 1.171 1997/08/09 05:42:34 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -504,6 +504,7 @@ mainInitialize(void) urlInitialize(); stat_init(&HTTPCacheInfo, Config.Log.access); stat_init(&ICPCacheInfo, NULL); + objcacheInit(); storeInit(); if (Config.effectiveUser) { diff --git a/src/protos.h b/src/protos.h index 71dda84be3..11d5aea64c 100644 --- a/src/protos.h +++ b/src/protos.h @@ -341,8 +341,7 @@ extern void netdbUpdatePeer _PARAMS((request_t *, peer * e, int rtt, int hops)); extern void objcachePasswdAdd _PARAMS((cachemgr_passwd **, char *, wordlist *)); extern void objcachePasswdDestroy _PARAMS((cachemgr_passwd ** a)); extern void objcacheStart _PARAMS((int fd, StoreEntry *)); - - +extern void objcacheInit _PARAMS((void)); extern void peerSelect _PARAMS((request_t *, StoreEntry *, PSC *, PSC *, void *data)); extern peer *peerGetSomeParent _PARAMS((request_t *, hier_code *)); @@ -387,6 +386,7 @@ extern void init_stack _PARAMS((Stack *, int)); extern void stackFreeMemory _PARAMS((Stack *)); extern void stat_init _PARAMS((cacheinfo **, const char *)); +extern void pconnHistCount _PARAMS((int, int)); /* To reduce memory fragmentation, we now store the memory version of an * object in fixed size blocks of size PAGE_SIZE and instead of calling @@ -555,3 +555,4 @@ extern OBJH info_get; extern OBJH server_list; extern OBJH parameter_get; extern OBJH storeDirStats; +extern OBJH pconnHistDump; diff --git a/src/stat.cc b/src/stat.cc index db974c9d65..feb1e202f8 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.151 1997/08/09 04:48:09 wessels Exp $ + * $Id: stat.cc,v 1.152 1997/08/09 05:42:36 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -137,6 +137,9 @@ static int memoryAccounted _PARAMS((void)); static void info_get_mallstat _PARAMS((int, int, StoreEntry *)); #endif +#define PCONN_HIST_SZ 256 +int client_pconn_hist[PCONN_HIST_SZ]; + /* process utilization information */ static void statUtilization(cacheinfo * obj, StoreEntry * sentry, const char *desc) @@ -837,7 +840,6 @@ stat_init(cacheinfo ** object, const char *logfilename) { cacheinfo *obj = NULL; int i; - debug(18, 5) ("stat_init: Initializing...\n"); obj = xcalloc(1, sizeof(cacheinfo)); if (logfilename) @@ -885,4 +887,33 @@ stat_init(cacheinfo ** object, const char *logfilename) obj->proto_stat_data[i].kb.now = 0; } *object = obj; + for (i=0; i= PCONN_HIST_SZ) + i = PCONN_HIST_SZ - 1; + /* what == 0 for client, 1 for server */ + if (what == 0) + client_pconn_hist[i]++; +} + +void +pconnHistDump(StoreEntry * e) +{ + int i; + storeAppendPrintf(e, + "Client-side persistent connection counts:\n" + "\n" + "req/\n" + "conn count\n" + "---- ---------\n"); + for (i = 0; i < PCONN_HIST_SZ; i++) { + if (client_pconn_hist[i] == 0) + continue; + storeAppendPrintf(e, "%4d %9d\n", i, client_pconn_hist[i]); + } }