/*
- * $Id: ipcache.cc,v 1.261 2007/05/29 13:31:40 amosjeffries Exp $
+ * $Id: ipcache.cc,v 1.262 2007/08/17 05:01:43 amosjeffries Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
int hits;
int misses;
int negative_hits;
+ int numeric_hits;
+ int invalid;
}
-
IpcacheStats;
static dlink_list lru_list;
if (name == NULL || name[0] == '\0') {
debugs(14, 4, "ipcache_nbgethostbyname: Invalid name!");
+ IpcacheStats.invalid++;
dns_error_message = "Invalid hostname";
handler(NULL, handlerData);
return;
if ((addrs = ipcacheCheckNumeric(name))) {
dns_error_message = NULL;
+ IpcacheStats.numeric_hits++;
handler(addrs, handlerData);
return;
}
dns_error_message = NULL;
- if ((addrs = ipcacheCheckNumeric(name)))
+ if ((addrs = ipcacheCheckNumeric(name))) {
+ IpcacheStats.numeric_hits++;
return addrs;
+ }
IpcacheStats.misses++;
dlink_node *m;
assert(ip_table != NULL);
storeAppendPrintf(sentry, "IP Cache Statistics:\n");
- storeAppendPrintf(sentry, "IPcache Entries: %d\n",
+ storeAppendPrintf(sentry, "IPcache Entries: %d\n",
memInUse(MEM_IPCACHE_ENTRY));
storeAppendPrintf(sentry, "IPcache Requests: %d\n",
IpcacheStats.requests);
- storeAppendPrintf(sentry, "IPcache Hits: %d\n",
+ storeAppendPrintf(sentry, "IPcache Hits: %d\n",
IpcacheStats.hits);
- storeAppendPrintf(sentry, "IPcache Negative Hits: %d\n",
+ storeAppendPrintf(sentry, "IPcache Negative Hits: %d\n",
IpcacheStats.negative_hits);
- storeAppendPrintf(sentry, "IPcache Misses: %d\n",
+ storeAppendPrintf(sentry, "IPcache Numeric Hits: %d\n",
+ IpcacheStats.numeric_hits);
+ storeAppendPrintf(sentry, "IPcache Misses: %d\n",
IpcacheStats.misses);
+ storeAppendPrintf(sentry, "IPcache Invalid Request: %d\n",
+ IpcacheStats.invalid);
storeAppendPrintf(sentry, "\n\n");
storeAppendPrintf(sentry, "IP Cache Contents:\n\n");
storeAppendPrintf(sentry, " %-29.29s %3s %6s %6s %1s\n",