From 0faf70d0ff54b1a1acebc0890fa1ce92777917c0 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Sat, 23 May 1998 05:14:20 +0000 Subject: [PATCH] Print Mean object size in 'info' page --- src/globals.h | 4 ++-- src/stat.cc | 4 +++- src/store_dir.cc | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/globals.h b/src/globals.h index 20f04d8746..9aa1a815b1 100644 --- a/src/globals.h +++ b/src/globals.h @@ -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; diff --git a/src/stat.cc b/src/stat.cc index c1fd9ff70e..fce3dcd4c0 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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); diff --git a/src/store_dir.cc b/src/store_dir.cc index 491db4ccb4..bf4d12087a 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -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 -- 2.47.3