]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Print Mean object size in 'info' page
authorwessels <>
Sat, 23 May 1998 05:14:20 +0000 (05:14 +0000)
committerwessels <>
Sat, 23 May 1998 05:14:20 +0000 (05:14 +0000)
src/globals.h
src/stat.cc
src/store_dir.cc

index 20f04d8746ecb68e4346f9a539bd1878fd82052b..9aa1a815b1ec0c2fdf125f98b84179d2d26e3dff 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.56 1998/05/22 02:52:21 rousskov Exp $
+ * $Id: globals.h,v 1.57 1998/05/22 23:14:20 wessels Exp $
  */
 
 extern FILE *debug_log;                /* NULL */
@@ -69,7 +69,7 @@ extern int theOutSnmpConnection;      /* -1 */
 extern char *snmp_agentinfo;
 #endif
 extern int vhost_mode;         /* 0 */
-extern int vizSock;            /* -1 */
+extern int n_disk_objects;     /* 0 */
 extern iostats IOStats;
 extern struct _acl_deny_info_list *DenyInfoList;       /* NULL */
 extern struct in_addr any_addr;
index c1fd9ff70ed5898ce6e31875da658797e758a593..fce3dcd4c0f5cdfb1673ae1a9786b13677f353ae 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.250 1998/05/21 03:22:46 wessels Exp $
+ * $Id: stat.cc,v 1.251 1998/05/22 23:14:21 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -502,6 +502,8 @@ info_get(StoreEntry * sentry)
        (int) (store_mem_size >> 10));
     storeAppendPrintf(sentry, "\tStorage LRU Expiration Age:\t%6.2f days\n",
        (double) storeExpiredReferenceAge() / 86400.0);
+    storeAppendPrintf(sentry, "\tMean Object Size:\t%0.2f KB\n",
+       n_disk_objects ? (double) store_swap_size / n_disk_objects : 0.0);
     storeAppendPrintf(sentry, "\tRequests given to unlinkd:\t%d\n",
        Counter.unlink.requests);
 
index 491db4ccb45b2bd83221fcbbbe026f905c0ab836..bf4d12087abf0dce112280daab517ce2a08566f8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.68 1998/05/15 20:31:41 wessels Exp $
+ * $Id: store_dir.cc,v 1.69 1998/05/22 23:14:22 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -579,6 +579,10 @@ storeDirUpdateSwapSize(int fn, size_t size, int sign)
     int k = ((size + 1023) >> 10) * sign;
     Config.cacheSwap.swapDirs[dirn].cur_size += k;
     store_swap_size += k;
+    if (sign > 0)
+       n_disk_objects++;
+    else if (sign < 0)
+       n_disk_objects--;
 }
 
 void