]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added reporting of swap and memory usage (%used, %free) to cachemgr info
authorwessels <>
Thu, 12 Apr 2007 23:00:34 +0000 (23:00 +0000)
committerwessels <>
Thu, 12 Apr 2007 23:00:34 +0000 (23:00 +0000)
page.

src/stat.cc

index d274cbba50abaa8c41dbe0b17e9ee4f4856c4b8e..265257ced9f41d268d260ff8fc10a4fe562c3f0b 100644 (file)
@@ -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);