/*
- * $Id: ipcache.cc,v 1.174 1998/03/31 04:08:32 wessels Exp $
+ * $Id: ipcache.cc,v 1.175 1998/04/01 05:38:57 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
if (strstr(dnsData->ip_inbuf, "$end\n")) {
/* end of record found */
statHistCount(&Counter.dns.svc_time,
- tvSubMsec(dnsData->dispatch_time, current_time));
+ tvSubMsec(i->request_time, current_time));
if ((x = ipcache_parsebuffer(dnsData->ip_inbuf, dnsData)) == NULL) {
debug(14, 0) ("ipcache_dnsHandleRead: ipcache_parsebuffer failed?!\n");
} else {
IpcacheStats.misses++;
i = ipcacheAddNew(name, NULL, IP_PENDING);
ipcacheAddPending(i, handler, handlerData);
+ i->request_time = current_time;
} else if (i->status == IP_CACHED || i->status == IP_NEGATIVE_CACHED) {
/* HIT */
debug(14, 4) ("ipcache_nbgethostbyname: HIT for '%s'\n", name);
/*
- * $Id: peer_select.cc,v 1.42 1998/03/16 23:21:33 wessels Exp $
+ * $Id: peer_select.cc,v 1.43 1998/04/01 05:38:59 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
psstate->fail_callback = fail_callback;
psstate->callback_data = callback_data;
cbdataLock(callback_data);
- psstate->icp.start = current_time;
peerSelectCheckAS(psstate);
}
} else if (peerSelectIcpPing(request, direct, entry)) {
assert(entry->ping_status == PING_NONE);
debug(44, 3) ("peerSelect: Doing ICP pings\n");
+ psstate->icp.start = current_time;
psstate->icp.n_sent = neighborsUdpPing(request,
entry,
peerHandleIcpReply,
/*
- * $Id: stat.cc,v 1.221 1998/03/31 05:37:50 wessels Exp $
+ * $Id: stat.cc,v 1.222 1998/04/01 05:39:04 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
static void statCountersClean(StatCounters *);
static void statCountersCopy(StatCounters * dest, const StatCounters * orig);
static void statCountersDump(StoreEntry * sentry);
+static double statMedianSvc(int, int);
static OBJH stat_io_get;
static OBJH stat_objects_get;
static OBJH stat_vmobjects_get;
storeAppendPrintf(sentry, "\tRequests given to unlinkd:\t%d\n",
Counter.unlink.requests);
+ storeAppendPrintf(sentry, "Median Service Times (seconds) 5 min 60 min:\n");
+ storeAppendPrintf(sentry, "\tHTTP Requests (All): %8.5f %8.5f\n",
+ statMedianSvc(5, MEDIAN_HTTP) / 1000.0,
+ statMedianSvc(60, MEDIAN_HTTP) / 1000.0);
+ storeAppendPrintf(sentry, "\tCache Misses: %8.5f %8.5f\n",
+ statMedianSvc(5, MEDIAN_MISS) / 1000.0,
+ statMedianSvc(60, MEDIAN_MISS) / 1000.0);
+ storeAppendPrintf(sentry, "\tCache Hits: %8.5f %8.5f\n",
+ statMedianSvc(5, MEDIAN_HIT) / 1000.0,
+ statMedianSvc(60, MEDIAN_HIT) / 1000.0);
+ storeAppendPrintf(sentry, "\tNot-Modified Replies: %8.5f %8.5f\n",
+ statMedianSvc(5, MEDIAN_NM) / 1000.0,
+ statMedianSvc(60, MEDIAN_NM) / 1000.0);
+ storeAppendPrintf(sentry, "\tDNS Lookups: %8.5f %8.5f\n",
+ statMedianSvc(5, MEDIAN_DNS) / 1000.0,
+ statMedianSvc(60, MEDIAN_DNS) / 1000.0);
+ storeAppendPrintf(sentry, "\tICP Queries: %8.5f %8.5f\n",
+ statMedianSvc(5, MEDIAN_ICP_QUERY) / 1000000.0,
+ statMedianSvc(60, MEDIAN_ICP_QUERY) / 1000000.0);
+
squid_getrusage(&rusage);
cputime = rusage_cputime(&rusage);
storeAppendPrintf(sentry, "Resource usage for %s:\n", appname);
statAvgDump(e, 60, 0);
}
-enum {
- HTTP_SVC, ICP_SVC, DNS_SVC
-};
-
-int
-get_median_svc(int interval, int which)
+static double
+statMedianSvc(int interval, int which)
{
StatCounters *f;
StatCounters *l;
assert(f);
assert(l);
switch (which) {
- case HTTP_SVC:
+ case MEDIAN_HTTP:
x = statHistDeltaMedian(&l->client_http.all_svc_time, &f->client_http.all_svc_time);
break;
- case ICP_SVC:
+ case MEDIAN_HIT:
+ x = statHistDeltaMedian(&l->client_http.hit_svc_time, &f->client_http.hit_svc_time);
+ break;
+ case MEDIAN_MISS:
+ x = statHistDeltaMedian(&l->client_http.miss_svc_time, &f->client_http.miss_svc_time);
+ break;
+ case MEDIAN_NM:
+ x = statHistDeltaMedian(&l->client_http.nm_svc_time, &f->client_http.nm_svc_time);
+ break;
+ case MEDIAN_ICP_QUERY:
x = statHistDeltaMedian(&l->icp.query_svc_time, &f->icp.query_svc_time);
break;
- case DNS_SVC:
+ case MEDIAN_DNS:
x = statHistDeltaMedian(&l->dns.svc_time, &f->dns.svc_time);
break;
default:
debug(49, 5) ("get_median_val: unknown type.\n");
x = 0;
}
- return (int) x;
+ return x;
+}
+
+/*
+ * SNMP wants ints, ick
+ */
+int
+get_median_svc(int interval, int which)
+{
+ return(int) statMedianSvc(interval, which);
}
StatCounters *