- Simpler cacheobj implementation.
+ - persistent connection histogram
Changes to squid-1.2.alpha5 ():
MGR_VM_OBJECTS,
MGR_STOREDIR,
MGR_CBDATA,
+ MGR_PCONN,
MGR_MAX
} objcache_op;
/*
- * $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
urlInitialize();
stat_init(&HTTPCacheInfo, Config.Log.access);
stat_init(&ICPCacheInfo, NULL);
+ objcacheInit();
storeInit();
if (Config.effectiveUser) {
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 *));
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
extern OBJH server_list;
extern OBJH parameter_get;
extern OBJH storeDirStats;
+extern OBJH pconnHistDump;
/*
- * $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
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)
{
cacheinfo *obj = NULL;
int i;
-
debug(18, 5) ("stat_init: Initializing...\n");
obj = xcalloc(1, sizeof(cacheinfo));
if (logfilename)
obj->proto_stat_data[i].kb.now = 0;
}
*object = obj;
+ for (i=0; i<PCONN_HIST_SZ; i++)
+ client_pconn_hist[i] = 0;
+}
+
+void
+pconnHistCount(int what, int i)
+{
+ if (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]);
+ }
}