answers10-100 counts the number of queries answered within 100 miliseconds
answers1-10 counts the number of queries answered within 10 miliseconds
answers-slow counts the number of queries answered after 1 second
+cache-bytes Size of the cache in bytes (since 3.3.1)
cache-entries shows the number of entries in the cache
cache-hits counts the number of cache hits since starting
cache-misses counts the number of cache misses since starting
nxdomain-answers counts the number of times it answered NXDOMAIN since starting
outgoing-timeouts counts the number of timeouts on outgoing UDP queries since starting
over-capacity-drops Questions dropped because over maximum concurrent query limit (since 3.2)
+packetcache-bytes Size of the packet cache in bytes (since 3.3.1)
packetcache-entries Size of packet cache (since 3.2)
packetcache-hits Packet cache hits (since 3.2)
packetcache-misses Packet cache misses (since 3.2)
return new uint64_t(t_RC->size());
}
+uint64_t* pleaseGetCacheBytes()
+{
+ return new uint64_t(t_RC->bytes());
+}
+
+
uint64_t doGetCacheSize()
{
return broadcastAccFunction<uint64_t>(pleaseGetCacheSize);
}
+uint64_t doGetCacheBytes()
+{
+ return broadcastAccFunction<uint64_t>(pleaseGetCacheBytes);
+}
+
uint64_t* pleaseGetCacheHits()
{
return new uint64_t(t_RC->cacheHits);
}
-
-
uint64_t* pleaseGetPacketCacheSize()
{
return new uint64_t(t_packetCache->size());
}
+uint64_t* pleaseGetPacketCacheBytes()
+{
+ return new uint64_t(t_packetCache->bytes());
+}
+
+
uint64_t doGetPacketCacheSize()
{
return broadcastAccFunction<uint64_t>(pleaseGetPacketCacheSize);
}
+uint64_t doGetPacketCacheBytes()
+{
+ return broadcastAccFunction<uint64_t>(pleaseGetPacketCacheBytes);
+}
+
+
uint64_t* pleaseGetPacketCacheHits()
{
return new uint64_t(t_packetCache->d_hits);
return broadcastAccFunction<uint64_t>(pleaseGetPacketCacheMisses);
}
+uint64_t doGetMallocated()
+{
+ // this turned out to be broken
+/* struct mallinfo mi = mallinfo();
+ return mi.uordblks; */
+ return 0;
+}
RecursorControlParser::RecursorControlParser()
{
addGetStat("cache-hits", doGetCacheHits);
addGetStat("cache-misses", doGetCacheMisses);
addGetStat("cache-entries", doGetCacheSize);
+ addGetStat("cache-bytes", doGetCacheBytes);
addGetStat("packetcache-hits", doGetPacketCacheHits);
addGetStat("packetcache-misses", doGetPacketCacheMisses);
addGetStat("packetcache-entries", doGetPacketCacheSize);
+ addGetStat("packetcache-bytes", doGetPacketCacheBytes);
-
+ addGetStat("malloc-bytes", doGetMallocated);
addGetStat("servfail-answers", &g_stats.servFails);
addGetStat("nxdomain-answers", &g_stats.nxDomains);
static void doExitNicely()
{
+ //extern void printCallers();
+ // printCallers();
doExitGeneric(true);
}
if(cmd=="quit-nicely") {
*command=&doExitNicely;
return "bye nicely\n";
- }
-
+ }
if(cmd=="dump-cache")
return doDumpCache(begin, end);
if(cmd=="reload-zones") {
return reloadAuthAndForwards();
}
-
+
return "Unknown command '"+cmd+"'\n";
}
#include <iostream>
+#include <boost/foreach.hpp>
#include "recpacketcache.hh"
#include "cachecleaner.hh"
#include "dns.hh"
return d_packetCache.size();
}
+uint64_t RecursorPacketCache::bytes()
+{
+ uint64_t sum=0;
+ BOOST_FOREACH(const struct Entry& e, d_packetCache) {
+ sum += sizeof(e) + e.d_packet.length() + 4;
+ }
+ return sum;
+}
+
+
void RecursorPacketCache::doPruneTo(unsigned int maxCached)
{
pruneCollection(d_packetCache, maxCached);