--------------------- PatchSet 1882 Date: 2001/04/11 09:35:39 Author: akroonmaa Branch: chunked_mempools Tag: (none) Log: 1) oops, alloc count = saved count, no point in showing in cachemgr. 2) HitRate % makes no sense with chunked pools, its always 100%, so make it into HitRate #/sec showing how busy any pool is. Members: src/MemPoolStats.c:1.1.2.3->1.1.2.4 Index: squid/src/MemPoolStats.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/MemPoolStats.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid/src/MemPoolStats.c 10 Apr 2001 14:02:30 -0000 1.1.2.3 +++ squid/src/MemPoolStats.c 11 Apr 2001 09:35:39 -0000 1.1.2.4 @@ -41,6 +41,8 @@ /* module globals */ static double clean_interval = 15.0; /* time to live of idle chunk before release */ +static double xm_time = 0; +static double xm_deltat = 0; /* huge constant to set mem_idle_limit to "unlimited" */ static const size_t mem_unlimited_size = 2 * 1024 * MB; @@ -171,7 +173,7 @@ int alloc_count, int inuse_count, int idle_count, StoreEntry * e) { assert(pm); - storeAppendPrintf(e, "%d\t %d\t %d\t %.2f\t %d\t %d\t %d\t %d\t %d\t %d\t %d\t %d\t %d\t %.1f\t %.1f\t %.1f\t %d\n", + storeAppendPrintf(e, "%d\t %d\t %d\t %.2f\t %d\t %d\t %d\t %d\t %d\t %d\t %d\t %d\t %d\t %.1f\t %.1f\t %.1f\n", /* alloc */ alloc_count, toKB(obj_size * pm->alloc.level), @@ -192,8 +194,8 @@ pm->saved.count, xpercent(pm->saved.count, mem_traffic_volume.count), xpercent(obj_size * gb_to_double(&pm->saved), gb_to_double(&mem_traffic_volume)), - xpercent(pm->saved.count, pm->total.count), - pm->total.count); + xdiv(pm->saved.count - pm->osaved.count, xm_deltat)); + pm->osaved.count = pm->saved.count; } /* to-do: make debug level a parameter? */ @@ -269,7 +271,7 @@ /* heading */ storeAppendPrintf(e, "Pool\t Obj Size\t" " Chunks\t\t\t\t\t\t" - "Allocated\t\t\t\t\t In Use\t\t\t\t Idle\t\t\t Allocations Saved\t\t\t Hit Rate\tAllocs\t\n" + "Allocated\t\t\t\t\t In Use\t\t\t\t Idle\t\t\t Allocations Saved\t\t\t Hit Rate\t\n" " \t (bytes)\t" "KB/ch\t obj/ch\t" "(#)\t used\t free\t %Fragm\t " @@ -277,10 +279,11 @@ "(#)\t (KB)\t high (KB)\t %%alloc\t" "(#)\t (KB)\t high (KB)\t" "(#)\t %%cnt\t %%vol\t" - "(%%num)\t" - "(#)" + "(#) / sec\t" "\n"); /* main table */ + xm_deltat = current_dtime - xm_time; + xm_time = current_dtime; for (i = 0; i < Pools.count ; i++) { const MemPool *pool = Pools.items[i]; if (memPoolWasUsed(pool)) {