From: rousskov <> Date: Tue, 14 Apr 1998 22:38:21 +0000 (+0000) Subject: - added cd.on_xition_count histogram to Counter X-Git-Tag: SQUID_3_0_PRE1~3503 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c135694e755d701a86492fd42f4cead25128c6f5;p=thirdparty%2Fsquid.git - added cd.on_xition_count histogram to Counter counts the number of 0->1 transitions during cacheDigestAdd() --- diff --git a/src/CacheDigest.cc b/src/CacheDigest.cc index 43fd747960..799b457c5f 100644 --- a/src/CacheDigest.cc +++ b/src/CacheDigest.cc @@ -1,6 +1,6 @@ /* - * $Id: CacheDigest.cc,v 1.12 1998/04/14 15:16:23 rousskov Exp $ + * $Id: CacheDigest.cc,v 1.13 1998/04/14 16:38:21 rousskov Exp $ * * DEBUG: section 70 Cache Digest * AUTHOR: Alex Rousskov @@ -131,10 +131,33 @@ cacheDigestAdd(CacheDigest * cd, const cache_key * key) /* hash */ cacheDigestHashKey(cd, key); /* turn on corresponding bits */ +#if CD_FAST_ADD CBIT_SET(cd->mask, hashed_keys[0]); CBIT_SET(cd->mask, hashed_keys[1]); CBIT_SET(cd->mask, hashed_keys[2]); CBIT_SET(cd->mask, hashed_keys[3]); +#else + { + int on_xition_cnt = 0; + if (!CBIT_TEST(cd->mask, hashed_keys[0])) { + CBIT_SET(cd->mask, hashed_keys[0]); + on_xition_cnt++; + } + if (!CBIT_TEST(cd->mask, hashed_keys[1])) { + CBIT_SET(cd->mask, hashed_keys[1]); + on_xition_cnt++; + } + if (!CBIT_TEST(cd->mask, hashed_keys[2])) { + CBIT_SET(cd->mask, hashed_keys[2]); + on_xition_cnt++; + } + if (!CBIT_TEST(cd->mask, hashed_keys[3])) { + CBIT_SET(cd->mask, hashed_keys[3]); + on_xition_cnt++; + } + statHistCount(&Counter.cd.on_xition_count, on_xition_cnt); + } +#endif cd->count++; } diff --git a/src/globals.h b/src/globals.h index 2932b1e1a1..a29dac2c2f 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.51 1998/04/07 23:29:55 rousskov Exp $ + * $Id: globals.h,v 1.52 1998/04/14 16:38:22 rousskov Exp $ */ extern FILE *debug_log; /* NULL */ @@ -98,6 +98,7 @@ extern dlink_list store_list; extern const String StringNull; /* { 0, 0, NULL } */ extern int hot_obj_count; /* 0 */ extern int _db_level; +extern const int CacheDigestHashCount; /* 4 */ extern CacheDigest *store_digest; /* NULL */ extern const char *StoreDigestUrlPath; /* "store_digest" */ extern const char *StoreDigestMimeStr; /* "application/cache-digest" */ diff --git a/src/stat.cc b/src/stat.cc index bad9998dec..55daed727b 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.237 1998/04/12 06:10:08 rousskov Exp $ + * $Id: stat.cc,v 1.238 1998/04/14 16:38:23 rousskov Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -880,6 +880,7 @@ statCountersInitSpecial(StatCounters * C) statHistLogInit(&C->icp.server_svc_time, 300, 0.0, 3600000.0 * 30.0); statHistEnumInit(&C->cd.peer_choice_count, Config.npeers); statHistEnumInit(&C->cd.peer_ichoice_count, Config.npeers); + statHistEnumInit(&C->cd.on_xition_count, CacheDigestHashCount); #endif } @@ -902,6 +903,7 @@ statCountersClean(StatCounters * C) statHistClean(&C->icp.server_svc_time); statHistClean(&C->cd.peer_choice_count); statHistClean(&C->cd.peer_ichoice_count); + statHistClean(&C->cd.on_xition_count); #endif } @@ -930,6 +932,7 @@ statCountersCopy(StatCounters * dest, const StatCounters * orig) statHistCopy(&dest->icp.server_svc_time, &orig->icp.server_svc_time); statHistCopy(&dest->cd.peer_choice_count, &orig->cd.peer_choice_count); statHistCopy(&dest->cd.peer_ichoice_count, &orig->cd.peer_ichoice_count); + statHistCopy(&dest->cd.on_xition_count, &orig->cd.on_xition_count); #endif } @@ -960,6 +963,8 @@ statCountersHistograms(StoreEntry *sentry) statHistDump(&f->cd.peer_choice_count, sentry, &statHistIntDumper); storeAppendPrintf(sentry, "\ncd.peer_ichoice_count histogram:\n"); statHistDump(&f->cd.peer_ichoice_count, sentry, &statHistIntDumper); + storeAppendPrintf(sentry, "\ncd.on_xition_count histogram:\n"); + statHistDump(&f->cd.on_xition_count, sentry, &statHistIntDumper); #endif #if TOO_MUCH_OUTPUT storeAppendPrintf(sentry, "icp.query_svc_time histogram:\n"); diff --git a/src/structs.h b/src/structs.h index 4af591073e..2c007fc1b3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1222,8 +1222,9 @@ struct _StatCounters { cd_guess_stats guess; StatHist client_svc_time; StatHist server_svc_time; - StatHist peer_choice_count; - StatHist peer_ichoice_count; + StatHist peer_choice_count; /* #peer select choices in peerSelectFoo */ + StatHist peer_ichoice_count; /* #peer select choices with rtt > 0 */ + StatHist on_xition_count; /* #(0->1) transitions during cacheDigestAdd */ } cd; #endif int page_faults;