/*
- * $Id: main.cc,v 1.443 2007/04/13 04:52:19 rousskov Exp $
+ * $Id: main.cc,v 1.444 2007/04/13 23:12:31 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
storeDigestRegisterWithCacheManager(manager);
StoreFileSystem::RegisterAllFsWithCacheManager(manager);
storeRegisterWithCacheManager(manager);
+ storeLogRegisterWithCacheManager(manager);
#if DEBUGSTRINGS
StringRegistry::Instance().registerWithCacheManager(manager);
/*
- * $Id: protos.h,v 1.538 2007/04/13 22:46:03 wessels Exp $
+ * $Id: protos.h,v 1.539 2007/04/13 23:12:31 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
SQUIDCEXTERN void storeLogRotate(void);
SQUIDCEXTERN void storeLogClose(void);
SQUIDCEXTERN void storeLogOpen(void);
+SQUIDCEXTERN void storeLogRegisterWithCacheManager(CacheManager &);
/*
/*
- * $Id: store_log.cc,v 1.28 2003/07/14 14:16:02 robertc Exp $
+ * $Id: store_log.cc,v 1.29 2007/04/13 23:12:31 wessels Exp $
*
* DEBUG: section 20 Storage Manager Logging Functions
* AUTHOR: Duane Wessels
#include "Store.h"
#include "MemObject.h"
#include "HttpReply.h"
+#include "CacheManager.h"
static const char *storeLogTags[] =
{
"SO_FAIL",
};
+static int storeLogTagsCounts[STORE_LOG_SWAPOUTFAIL+1];
+static OBJH storeLogTagsHist;
+
static Logfile *storelog = NULL;
void
#endif
+ storeLogTagsCounts[tag]++;
if (mem != NULL) {
if (mem->log_url == NULL) {
debug(20, 1) ("storeLog: NULL log_url for %s\n", mem->url);
storelog = logfileOpen(Config.Log.store, 0, 1);
}
+
+void
+storeLogRegisterWithCacheManager(CacheManager & manager)
+{
+ manager.registerAction("store_log_tags",
+ "Histogram of store.log tags",
+ storeLogTagsHist, 0, 1);
+}
+
+void
+storeLogTagsHist(StoreEntry *e)
+{
+ int tag;
+ for (tag = 0; tag <= STORE_LOG_SWAPOUTFAIL; tag++) {
+ storeAppendPrintf(e, "%s %d\n",
+ storeLogTags[tag],
+ storeLogTagsCounts[tag]);
+ }
+}