/*
- * $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
/* 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++;
}
/*
- * $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 */
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" */
/*
- * $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
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
}
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
}
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
}
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");
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;