From: wessels <> Date: Thu, 12 Apr 2007 23:00:34 +0000 (+0000) Subject: Added reporting of swap and memory usage (%used, %free) to cachemgr info X-Git-Tag: SQUID_3_0_PRE6~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a52823b02567168bf397199c205238fc246aeac;p=thirdparty%2Fsquid.git Added reporting of swap and memory usage (%used, %free) to cachemgr info page. --- diff --git a/src/stat.cc b/src/stat.cc index d274cbba50..265257ced9 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,5 +1,5 @@ /* - * $Id: stat.cc,v 1.399 2007/02/25 11:32:32 hno Exp $ + * $Id: stat.cc,v 1.400 2007/04/12 17:00:34 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -540,9 +540,18 @@ info_get(StoreEntry * sentry) storeAppendPrintf(sentry, "\tStorage Swap size:\t%lu KB\n", store_swap_size); + storeAppendPrintf(sentry, "\tStorage Swap capacity:\t%4.1f%% used, %4.1f%% free\n", + dpercent((int) store_swap_size, (int) Store::Root().maxSize()), + dpercent((int) (Store::Root().maxSize() - store_swap_size), (int) Store::Root().maxSize())); + + storeAppendPrintf(sentry, "\tStorage Mem size:\t%d KB\n", (int) (mem_node::store_mem_size >> 10)); + storeAppendPrintf(sentry, "\tStorage Mem capacity:\t%4.1f%% used, %4.1f%% free\n", + dpercent(mem_node::InUseCount(), store_pages_max), + dpercent((store_pages_max - mem_node::InUseCount()), store_pages_max)); + storeAppendPrintf(sentry, "\tMean Object Size:\t%0.2f KB\n", n_disk_objects ? (double) store_swap_size / n_disk_objects : 0.0);