]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Transitioning Cache Digests from "experimental" to fundamental.
authorwessels <>
Thu, 14 May 1998 22:33:47 +0000 (22:33 +0000)
committerwessels <>
Thu, 14 May 1998 22:33:47 +0000 (22:33 +0000)
Removed a lot of stats collection, espeically large histograms.
Made peerDigestInit() called from an event, instead of being
called directly -- this avoids some recursion.
The selection algorithm is still kind of hard coded as follows:
cache digests
netdb (if CD's miss)
ICP (if netdb has no RTT data)

src/CacheDigest.cc
src/client_side.cc
src/enums.h
src/neighbors.cc
src/net_db.cc
src/peer_digest.cc
src/peer_select.cc
src/protos.h
src/stat.cc
src/structs.h

index 08863c568366ed14e7dc486c78837479a403f024..03611c5b657a4836cc023c814a9d614e957c2b7b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: CacheDigest.cc,v 1.20 1998/05/13 22:59:44 wessels Exp $
+ * $Id: CacheDigest.cc,v 1.21 1998/05/14 16:33:47 wessels Exp $
  *
  * DEBUG: section 70    Cache Digest
  * AUTHOR: Alex Rousskov
@@ -161,9 +161,7 @@ cacheDigestAdd(CacheDigest * cd, const cache_key * key)
            CBIT_SET(cd->mask, hashed_keys[3]);
            on_xition_cnt++;
        }
-#if USE_CACHE_DIGESTS
        statHistCount(&Counter.cd.on_xition_count, on_xition_cnt);
-#endif
     }
 #endif
     cd->count++;
index 7c0dd99d7d5925013dc6f3d2e8796172e25a3113..b7bd80af9dc929e7245149404e7c9b609a71f6dd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.305 1998/05/13 23:09:47 wessels Exp $
+ * $Id: client_side.cc,v 1.306 1998/05/14 16:33:48 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -537,16 +537,18 @@ checkNegativeHit(StoreEntry * e)
     return 1;
 }
 
+static void
+updateCDJunkStats()
+{
+       /* rewrite */
+}
+
 void
 clientUpdateCounters(clientHttpRequest * http)
 {
     int svc_time = tvSubMsec(http->start, current_time);
     icp_ping_data *i;
-#if USE_CACHE_DIGESTS
-    const HttpReply *reply = NULL;
-    int sst = 0;               /* server-side service time */
     HierarchyLogEntry *H;
-#endif
     Counter.client_http.requests++;
     if (isTcpHit(http->log_type))
        Counter.client_http.hits++;
@@ -575,81 +577,26 @@ clientUpdateCounters(clientHttpRequest * http)
        /* make compiler warnings go away */
        break;
     }
-    i = &http->request->hier.icp;
-    if (0 != i->stop.tv_sec && 0 != i->start.tv_sec)
-       statHistCount(&Counter.icp.query_svc_time, tvSubUsec(i->start, i->stop));
-    if (i->timeout)
-       Counter.icp.query_timeouts++;
-#if USE_CACHE_DIGESTS
     H = &http->request->hier;
-    if (H->peer_select_start.tv_sec && H->store_complete_stop.tv_sec)
-       sst = tvSubMsec(H->peer_select_start, H->store_complete_stop);
-    if (H->alg == PEER_SA_ICP) {
-       statHistCount(&Counter.icp.client_svc_time, svc_time);
-       if (sst)
-           statHistCount(&Counter.icp.server_svc_time, sst);
-       Counter.icp.times_used++;
-    } else if (H->alg == PEER_SA_DIGEST) {
-       statHistCount(&Counter.cd.client_svc_time, svc_time);
-       if (sst)
-           statHistCount(&Counter.cd.server_svc_time, sst);
+    switch (H->alg) {
+    case PEER_SA_DIGEST:
        Counter.cd.times_used++;
-    } else {
-       assert(H->alg == PEER_SA_NONE);
-    }
-    /* account for outgoing digest traffic */
-    if (http->flags.internal && strStr(http->request->urlpath, StoreDigestUrlPath)) {
-       kb_incr(&Counter.cd.kbytes_sent, http->out.size);
-       Counter.cd.msgs_sent++;
-       debug(33, 1) ("Client %s requested local cache digest (%d bytes)\n",
-           inet_ntoa(http->request->client_addr), http->out.size);
-    }
-    /* @?@ split this ugly if-monster */
-    if (
-    /* we used ICP or CD for peer selecton */
-       H->alg != PEER_SA_NONE &&
-    /* a successful CD lookup was made */
-       H->cd_lookup != LOOKUP_NONE &&
-    /* it was not a CD miss (we go direct on CD MISSes) */
-       !(H->alg == PEER_SA_DIGEST && H->cd_lookup == LOOKUP_MISS) &&
-    /* request was cachable */
-       !EBIT_TEST(http->request->flags, REQ_NOCACHE) &&
-       EBIT_TEST(http->request->flags, REQ_CACHABLE) &&
-    /* paranoid: we have a reply pointer */
-       (reply = storeEntryReply(http->entry))) {
-
-       /* tmp, remove this later */
-       const char *x_cache_lookup_fld = httpHeaderGetLastStr(&reply->header, HDR_X_CACHE_LOOKUP);
-       const int lookup_hit = x_cache_lookup_fld && !strncmp(x_cache_lookup_fld, "HIT", 3);
-       /* end of tmp hack */
-       const char *x_cache_fld = httpHeaderGetLastStr(&reply->header, HDR_X_CACHE);
-       const int real_hit = x_cache_fld && !strncmp(x_cache_fld, "HIT", 3);
-       const int guess_hit = LOOKUP_HIT == H->cd_lookup;
-       peer *peer = peerFindByName(H->cd_host);
-
-       debug(33, 3) ("clientUpdateCounters: peer %s real/guess: %d/%d (%d) for %s!\n",
-           H->cd_host, real_hit, guess_hit, lookup_hit, http->request->host);
-       cacheDigestGuessStatsUpdate(&Counter.cd.guess, real_hit, guess_hit);
-       /* tmp hack */
-       if (lookup_hit && guess_hit && !real_hit)
-           Counter.cd.guess.close_hits++;
-       if (peer) {
-           cacheDigestGuessStatsUpdate(&peer->digest.stats.guess,
-               real_hit, guess_hit);
-           /* tmp hack */
-           if (lookup_hit && guess_hit && !real_hit)
-               peer->digest.stats.guess.close_hits++;
-       } else {
-           /* temporary paranoid debug @?@ */
-           static int max_count = 200;
-           if (max_count > 0) {
-               debug(33, 1) ("clientUpdateCounters: lost peer %s for %s! (%d)\n",
-                   H->cd_host, http->request->host, max_count);
-               max_count--;
-           }
-       }
+       break;
+    case PEER_SA_ICP:
+       Counter.icp.times_used++;
+       i = &H->icp;
+       if (0 != i->stop.tv_sec && 0 != i->start.tv_sec)
+           statHistCount(&Counter.icp.query_svc_time,
+               tvSubUsec(i->start, i->stop));
+       if (i->timeout)
+           Counter.icp.query_timeouts++;
+       break;
+    case PEER_SA_NETDB:
+       Counter.netdb.times_used++;
+       break;
+    default:
+       break;
     }
-#endif
 }
 
 static void
index 030b3c46bb7ce75d6174ea419a06660bb514aa07..3d0261ee128a05dd83afeb360df58eddbb4f3ff9 100644 (file)
@@ -131,7 +131,8 @@ typedef enum {
 typedef enum {
     PEER_SA_NONE,
     PEER_SA_DIGEST,
-    PEER_SA_ICP
+    PEER_SA_ICP,
+    PEER_SA_NETDB
 } peer_select_alg_t;
 
 typedef enum {
@@ -267,6 +268,7 @@ typedef enum {
     NO_PARENT_DIRECT,
     FIRST_PARENT_MISS,
     CLOSEST_PARENT_MISS,
+    CLOSEST_PARENT,
     CLOSEST_DIRECT,
     NO_DIRECT_FAIL,
     SOURCE_FASTEST,
@@ -409,7 +411,8 @@ enum {
     PD_INITED,                 /* initialized */
     PD_USABLE,                 /* ready to use */
     PD_REQUESTED,              /* we are in the process of receiving a [fresh] digest */
-    PD_DISABLED                        /* do not use/validate the digest */
+    PD_DISABLED,               /* do not use/validate the digest */
+    PD_INIT_PENDING
 } peer_cd_t;
 
 /* These are for StoreEntry->flag, which is defined as a SHORT */
index 38361b36eea7c8723d71d2bdc27fbcfaadcf49b6..523b8685b01675d1ea237115830a670f3f3bd1b3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.207 1998/05/12 20:14:05 wessels Exp $
+ * $Id: neighbors.cc,v 1.208 1998/05/14 16:33:51 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -555,27 +555,34 @@ peerDigestLookup(peer * p, request_t * request, StoreEntry * entry)
     const cache_key *key = request ? storeKeyPublic(storeUrl(entry), request->method) : NULL;
     assert(p);
     assert(request);
-    debug(15, 5) ("neighborsDigestPeerLookup: peer %s\n", p->host);
+    debug(15, 5) ("peerDigestLookup: peer %s\n", p->host);
     /* does the peeer have a valid digest? */
     if (EBIT_TEST(p->digest.flags, PD_DISABLED)) {
+       debug(15, 5) ("peerDigestLookup: Disabled!\n");
        return LOOKUP_NONE;
     } else if (!peerAllowedToUse(p, request)) {
+       debug(15, 5) ("peerDigestLookup: !peerAllowedToUse()\n");
        return LOOKUP_NONE;
     } else if (EBIT_TEST(p->digest.flags, PD_USABLE)) {
+       debug(15, 5) ("peerDigestLookup: Usable!\n");
        /* fall through; put here to have common case on top */ ;
     } else if (!EBIT_TEST(p->digest.flags, PD_INITED)) {
-       peerDigestInit(p);
+       debug(15, 5) ("peerDigestLookup: !initialized\n");
+       if (!EBIT_TEST(p->digest.flags, PD_INIT_PENDING)) {
+           EBIT_SET(p->digest.flags, PD_INIT_PENDING);
+           eventAdd("peerDigestInit", peerDigestInit, p, 0);
+       }
        return LOOKUP_NONE;
     } else {
-       assert(EBIT_TEST(p->digest.flags, PD_REQUESTED));
+       debug(15, 5) ("peerDigestLookup: Whatever!\n");
        return LOOKUP_NONE;
     }
-    debug(15, 5) ("neighborsDigestPeerLookup: OK to lookup peer %s\n", p->host);
+    debug(15, 5) ("peerDigestLookup: OK to lookup peer %s\n", p->host);
     assert(p->digest.cd);
     /* does digest predict a hit? */
     if (!cacheDigestTest(p->digest.cd, key))
        return LOOKUP_MISS;
-    debug(15, 5) ("neighborsDigestPeerLookup: peer %s says HIT!\n", p->host);
+    debug(15, 5) ("peerDigestLookup: peer %s says HIT!\n", p->host);
     return LOOKUP_HIT;
 #endif
     return LOOKUP_NONE;
index 6db765731f5662f515753be274573ac3ff929a76..6b6b18dd204648b4778401258cd52df96d059682 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: net_db.cc,v 1.99 1998/05/11 20:35:32 wessels Exp $
+ * $Id: net_db.cc,v 1.100 1998/05/14 16:33:52 wessels Exp $
  *
  * DEBUG: section 37    Network Measurement Database
  * AUTHOR: Duane Wessels
@@ -1068,3 +1068,40 @@ netdbExchangeStart(void *data)
     httpStart(ex->r, ex->e, NULL);
 #endif
 }
+
+peer *
+netdbClosestParent(const char *host)
+{
+    peer *p = NULL;
+#if USE_ICMP
+    netdbEntry *n;
+    const ipcache_addrs *ia;
+    net_db_peer *h;
+    int i;
+    n = netdbLookupHost(host);
+    if (NULL == n) {
+       /* try IP addr */
+       ia = ipcache_gethostbyname(host, 0);
+       if (NULL != ia)
+           n = netdbLookupAddr(ia->in_addrs[ia->cur]);
+    }
+    if (NULL == n)
+       return NULL;
+    if (0 == n->n_peers)
+       return NULL;
+    /* 
+     * Find the parent with the least RTT to the origin server.
+     * Make sure we don't return a parent who is farther away than
+     * we are.  Note, the n->peers list is pre-sorted by RTT.
+     */
+    for (i = 0; i < n->n_peers; i++) {
+       h = &n->peers[i];
+       if (n->rtt > 0)
+           if (n->rtt < h->rtt)
+               break;
+       if ((p = peerFindByName(h->peername)))
+           return p;
+    }
+#endif
+    return NULL;
+}
index a92c25e5b3084ec383896b91c1f6b4e484838c31..41e6da83cdfd6a6219b9ad7b97b14686207c7f26 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_digest.cc,v 1.27 1998/05/12 22:07:36 rousskov Exp $
+ * $Id: peer_digest.cc,v 1.28 1998/05/14 16:33:52 wessels Exp $
  *
  * DEBUG: section 72    Peer Digest Routines
  * AUTHOR: Alex Rousskov
@@ -67,20 +67,22 @@ static const time_t GlobalDigestRequestMinGap = 1 * 60;             /* seconds */
 static time_t global_last_req_timestamp = 0;
 
 void
-peerDigestInit(peer * p)
+peerDigestInit(void *data)
 {
+    peer *p = data;
     assert(p);
-    assert(!p->digest.flags);
+    assert(p->digest.flags == (1<<PD_INIT_PENDING));
     assert(!p->digest.cd);
     assert(SM_PAGE_SIZE == 4096);      /* we use MEM_4K_BUF */
-    /* set "init" flag here so we are not called after peerDigestValidate */
-    EBIT_SET(p->digest.flags, PD_INITED);
+debug(0,0)("peerDigestInit: called for %s\n", p->host);
     if (EBIT_TEST(p->options, NEIGHBOR_NO_DIGEST)) {
        peerDigestDisable(p);
     } else {
        cbdataLock(p);
        peerDigestValidate(p);
     }
+    EBIT_SET(p->digest.flags, PD_INITED);
+    EBIT_CLR(p->digest.flags, PD_INIT_PENDING);
 }
 
 /* no pending events or requests should exist when you call this */
index 84f1dabbf206a6088a597723278065c09474b362..e105c97584ed8a6f88b84c79269a2feea437a179 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.55 1998/04/24 18:47:42 wessels Exp $
+ * $Id: peer_select.cc,v 1.56 1998/05/14 16:33:53 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -43,6 +43,7 @@ const char *hier_strings[] =
     "NO_PARENT_DIRECT",
     "FIRST_PARENT_MISS",
     "CLOSEST_PARENT_MISS",
+    "CLOSEST_PARENT",
     "CLOSEST_DIRECT",
     "NO_DIRECT_FAIL",
     "SOURCE_FASTEST",
@@ -279,63 +280,45 @@ peerSelectFoo(ps_state * psstate)
     psstate->single_parent = getSingleParent(request);
     if (psstate->single_parent != NULL) {
        debug(44, 3) ("peerSelect: found single parent, skipping ICP query\n");
-    } else if (peerSelectIcpPing(request, direct, entry)) {
-       assert(entry->ping_status == PING_NONE);
 #if USE_CACHE_DIGESTS
-       /* which algorithm to use? */
-       if (squid_random() & 1) {
-           debug(44, 2) ("peerSelect: Using Cache Digest\n");
-           request->hier.alg = PEER_SA_DIGEST;
-           if (1 /* global_digested_peer_count */ )
-               p = neighborsDigestSelect(request, entry);
-           /* update counters */
-           statHistCount(&Counter.cd.peer_choice_count, request->hier.n_choices);
-           statHistCount(&Counter.cd.peer_ichoice_count, request->hier.n_ichoices);
-           code = DIRECT;
-           switch (request->hier.cd_lookup) {
-           case LOOKUP_HIT:
-               assert(p);
-               code = CACHE_DIGEST_HIT;
-               debug(44, 2) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
-               hierarchyNote(&request->hier, code, &psstate->icp, p->host);
-               peerSelectCallback(psstate, p);         /* @?@: p used to be NULL */
-               return;
-           case LOOKUP_MISS:
-               code = NO_CACHE_DIGEST_DIRECT;
-               /* fall through */
-           case LOOKUP_NONE:
-               /* go direct */
-               debug(44, 2) ("peerSelect: %s/%s\n", hier_strings[code], request->host);
-               hierarchyNote(&request->hier, code, &psstate->icp, request->host);
-               peerSelectCallback(psstate, NULL);
-               return;
-           default:
-               assert(0);      /* invalid lookup code */
-           }
-           assert(0);          /* never reached */
-       } else {
-           request->hier.alg = PEER_SA_ICP;
+    } else if ((p = neighborsDigestSelect(request, entry))) {
+       debug(44, 2) ("peerSelect: Using Cache Digest\n");
+       request->hier.alg = PEER_SA_DIGEST;
+       code = CACHE_DIGEST_HIT;
+       debug(44, 2) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
+       hierarchyNote(&request->hier, code, &psstate->icp, p->host);
+       peerSelectCallback(psstate, p);
+       return;
 #endif
-           debug(44, 3) ("peerSelect: Doing ICP pings\n");
-           psstate->icp.start = current_time;
-           psstate->icp.n_sent = neighborsUdpPing(request,
-               entry,
-               peerHandleIcpReply,
+    } else if ((p = netdbClosestParent(request->host))) {
+       request->hier.alg = PEER_SA_NETDB;
+       code = CLOSEST_PARENT;
+       debug(44, 2) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
+        hierarchyNote(&request->hier, code, &psstate->icp, p->host);
+        peerSelectCallback(psstate, p);
+        return;
+    } else if (peerSelectIcpPing(request, direct, entry)) {
+       assert(entry->ping_status == PING_NONE);
+       request->hier.alg = PEER_SA_ICP;
+       debug(44, 3) ("peerSelect: Doing ICP pings\n");
+       psstate->icp.start = current_time;
+       psstate->icp.n_sent = neighborsUdpPing(request,
+           entry,
+           peerHandleIcpReply,
+           psstate,
+           &psstate->icp.n_replies_expected);
+       if (psstate->icp.n_sent == 0)
+           debug(44, 0) ("WARNING: neighborsUdpPing returned 0\n");
+       debug(44,3)("peerSelectFoo: %d ICP replies expected\n",
+               psstate->icp.n_replies_expected);
+       if (psstate->icp.n_replies_expected > 0) {
+           entry->ping_status = PING_WAITING;
+           eventAdd("peerPingTimeout",
+               peerPingTimeout,
                psstate,
-               &psstate->icp.n_replies_expected);
-           if (psstate->icp.n_sent == 0)
-               debug(44, 0) ("WARNING: neighborsUdpPing returned 0\n");
-           if (psstate->icp.n_replies_expected > 0) {
-               entry->ping_status = PING_WAITING;
-               eventAdd("peerPingTimeout",
-                   peerPingTimeout,
-                   psstate,
-                   Config.neighborTimeout);
-               return;
-           }
-#if USE_CACHE_DIGESTS
+               Config.neighborTimeout);
+           return;
        }
-#endif
     }
     debug(44, 3) ("peerSelectFoo: After peerSelectIcpPing.\n");
     if (peerCheckNetdbDirect(psstate)) {
@@ -433,7 +416,7 @@ peerHandleIcpReply(peer * p, peer_t type, icp_common_t * header, void *data)
     debug(44, 3) ("peerHandleIcpReply: %s %s\n",
        icp_opcode_str[op],
        storeUrl(psstate->entry));
-#if USE_CACHE_DIGESTS
+#if USE_CACHE_DIGESTS && 0
     /* do cd lookup to count false misses */
     if (p && request)
        peerNoteDigestLookup(request, p,
index fe1d0b6c052949096fcbf70ea6e73a4ea408dda3..b09c1a6f808d3bcb482f3d711d45bddaf4725353 100644 (file)
@@ -538,6 +538,7 @@ extern int netdbHostPeerRtt(const char *host, peer * peer);
 extern void netdbBinaryExchange(StoreEntry *);
 extern EVH netdbExchangeStart;
 extern void netdbExchangeUpdatePeer(struct in_addr, peer *, double, double);
+extern peer *netdbClosestParent(const char *host);
 
 extern void cachemgrStart(int fd, request_t * request, StoreEntry * entry);
 extern void cachemgrRegister(const char *, const char *, OBJH *, int);
@@ -548,7 +549,7 @@ extern peer *peerGetSomeParent(request_t *, hier_code *);
 extern void peerSelectInit(void);
 
 /* peer_digest.c */
-extern void peerDigestInit(peer * p);
+extern EVH peerDigestInit;
 
 extern void protoDispatch(int, StoreEntry *, request_t *);
 
index 74dcd1cfb5ce71d81a5677e6a79ae7254cedd65c..dd22c0e14f0c05ca1da3bac1e5ba9724c3c46d03 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.245 1998/04/27 17:25:01 rousskov Exp $
+ * $Id: stat.cc,v 1.246 1998/05/14 16:33:55 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -656,33 +656,6 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours)
     storeAppendPrintf(sentry, "client_http.hit_median_svc_time = %f seconds\n",
        x / 1000.0);
 
-#if USE_CACHE_DIGESTS
-    storeAppendPrintf(sentry, "cd.msgs_sent = %f/sec\n",
-       XAVG(cd.msgs_sent));
-    storeAppendPrintf(sentry, "cd.msgs_recv = %f/sec\n",
-       XAVG(cd.msgs_recv));
-    storeAppendPrintf(sentry, "cd.kbytes_sent = %f/sec\n",
-       XAVG(cd.kbytes_sent.kb));
-    storeAppendPrintf(sentry, "cd.kbytes_recv = %f/sec\n",
-       XAVG(cd.kbytes_recv.kb));
-    x = statHistDeltaMedian(&l->cd.client_svc_time,
-       &f->cd.client_svc_time);
-    storeAppendPrintf(sentry, "cd.client_median_svc_time = %f seconds\n",
-       x / 1000.0);
-    x = statHistDeltaMedian(&l->cd.server_svc_time,
-       &f->cd.server_svc_time);
-    storeAppendPrintf(sentry, "cd.server_median_svc_time = %f seconds\n",
-       x / 1000.0);
-    x = statHistDeltaMedian(&l->icp.client_svc_time,
-       &f->icp.client_svc_time);
-    storeAppendPrintf(sentry, "icp.client_median_svc_time = %f seconds\n",
-       x / 1000.0);
-    x = statHistDeltaMedian(&l->icp.server_svc_time,
-       &f->icp.server_svc_time);
-    storeAppendPrintf(sentry, "icp.server_median_svc_time = %f seconds\n",
-       x / 1000.0);
-#endif
-
     storeAppendPrintf(sentry, "server.all.requests = %f/sec\n",
        XAVG(server.all.requests));
     storeAppendPrintf(sentry, "server.all.errors = %f/sec\n",
@@ -876,18 +849,10 @@ statCountersInitSpecial(StatCounters * C)
      * DNS svc_time hist is kept in milli-seconds; max of 10 minutes.
      */
     statHistLogInit(&C->dns.svc_time, 300, 0.0, 60000.0 * 10.0);
-#if USE_CACHE_DIGESTS
     /*
-     * Digested and ICPed cvs times in milli-seconds; max of 3 hours.
+     * Cache Digest Stuff
      */
-    statHistLogInit(&C->cd.client_svc_time, 300, 0.0, 3600000.0 * 30.0);
-    statHistLogInit(&C->icp.client_svc_time, 300, 0.0, 3600000.0 * 30.0);
-    statHistLogInit(&C->cd.server_svc_time, 300, 0.0, 3600000.0 * 30.0);
-    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, CacheDigestHashFuncCount);
-#endif
 }
 
 /* add special cases here as they arrive */
@@ -902,15 +867,7 @@ statCountersClean(StatCounters * C)
     statHistClean(&C->icp.query_svc_time);
     statHistClean(&C->icp.reply_svc_time);
     statHistClean(&C->dns.svc_time);
-#if USE_CACHE_DIGESTS
-    statHistClean(&C->cd.client_svc_time);
-    statHistClean(&C->icp.client_svc_time);
-    statHistClean(&C->cd.server_svc_time);
-    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
 }
 
 /* add special cases here as they arrive */
@@ -931,15 +888,7 @@ statCountersCopy(StatCounters * dest, const StatCounters * orig)
     statHistCopy(&dest->icp.query_svc_time, &orig->icp.query_svc_time);
     statHistCopy(&dest->icp.reply_svc_time, &orig->icp.reply_svc_time);
     statHistCopy(&dest->dns.svc_time, &orig->dns.svc_time);
-#if USE_CACHE_DIGESTS
-    statHistCopy(&dest->cd.client_svc_time, &orig->cd.client_svc_time);
-    statHistCopy(&dest->icp.client_svc_time, &orig->icp.client_svc_time);
-    statHistCopy(&dest->cd.server_svc_time, &orig->cd.server_svc_time);
-    statHistCopy(&dest->icp.server_svc_time, &orig->icp.server_svc_time);
-    statHistSafeCopy(&dest->cd.peer_choice_count, &orig->cd.peer_choice_count);
-    statHistSafeCopy(&dest->cd.peer_ichoice_count, &orig->cd.peer_ichoice_count);
     statHistCopy(&dest->cd.on_xition_count, &orig->cd.on_xition_count);
-#endif
 }
 
 static void
@@ -954,29 +903,6 @@ statCountersHistograms(StoreEntry * sentry)
     statHistDump(&f->client_http.nm_svc_time, sentry, NULL);
     storeAppendPrintf(sentry, "client_http.hit_svc_time histogram:\n");
     statHistDump(&f->client_http.hit_svc_time, sentry, NULL);
-#endif
-#if USE_CACHE_DIGESTS
-    StatCounters *f = &Counter;
-    storeAppendPrintf(sentry, "\nicp.query_svc_time histogram:\n");
-    statHistDump(&f->icp.query_svc_time, sentry, NULL);
-    storeAppendPrintf(sentry, "\nicp.reply_svc_time histogram:\n");
-    statHistDump(&f->icp.reply_svc_time, sentry, NULL);
-    storeAppendPrintf(sentry, "\nicp.server_svc_time histogram:\n");
-    statHistDump(&f->icp.server_svc_time, sentry, NULL);
-    storeAppendPrintf(sentry, "\nicp.client_svc_time histogram:\n");
-    statHistDump(&f->icp.client_svc_time, sentry, NULL);
-    storeAppendPrintf(sentry, "\ncd.server_svc_time histogram:\n");
-    statHistDump(&f->cd.server_svc_time, sentry, NULL);
-    storeAppendPrintf(sentry, "\ncd.client_svc_time histogram:\n");
-    statHistDump(&f->cd.client_svc_time, sentry, NULL);
-    storeAppendPrintf(sentry, "\ncd.peer_choice_count histogram:\n");
-    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");
     statHistDump(&f->icp.query_svc_time, sentry, NULL);
     storeAppendPrintf(sentry, "icp.reply_svc_time histogram:\n");
index bd2268d7ac3ea79a74f0cc69fbd1601d936cee96..39921b93a69664cc903ae903f2b34ae83b81f181 100644 (file)
@@ -612,7 +612,6 @@ struct _HierarchyLogEntry {
     hier_code code;
     char host[SQUIDHOSTNAMELEN];
     icp_ping_data icp;
-#if USE_CACHE_DIGESTS
     char cd_host[SQUIDHOSTNAMELEN];    /* the host of selected by cd peer */
     peer_select_alg_t alg;     /* peer selection algorithm */
     lookup_t cd_lookup;                /* cd prediction: none, miss, hit */
@@ -620,7 +619,6 @@ struct _HierarchyLogEntry {
     int n_ichoices;            /* #peers with known rtt we selected from (cd only) */
     struct timeval peer_select_start;
     struct timeval store_complete_stop;
-#endif
 };
 
 struct _AccessLogEntry {
@@ -1221,11 +1219,7 @@ struct _StatCounters {
        StatHist query_svc_time;
        StatHist reply_svc_time;
        int query_timeouts;
-#if USE_CACHE_DIGESTS
-       StatHist client_svc_time;
-       StatHist server_svc_time;
        int times_used;
-#endif
     } icp;
     struct {
        int requests;
@@ -1233,7 +1227,6 @@ struct _StatCounters {
     struct {
        StatHist svc_time;
     } dns;
-#if USE_CACHE_DIGESTS
     struct {
        int times_used;
        kb_t kbytes_sent;
@@ -1242,13 +1235,11 @@ struct _StatCounters {
        int msgs_sent;
        int msgs_recv;
        cd_guess_stats guess;
-       StatHist client_svc_time;
-       StatHist server_svc_time;
-       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 */
+       StatHist on_xition_count;
     } cd;
-#endif
+    struct {
+       int times_used;
+    } netdb;
     int page_faults;
     int select_loops;
     double cputime;