uint64_t getInsertCollisions() const { return d_insertCollisions; }
uint64_t getMaxEntries() const { return d_maxEntries; }
uint64_t getTTLTooShorts() const { return d_ttlTooShorts; }
+ uint64_t getCleanupCount() const { return d_cleanupCount; }
uint64_t getEntriesCount();
uint64_t dump(int fd);
void setSkippedOptions(const std::unordered_set<uint16_t>& optionsToSkip);
pdns::stat_t d_insertCollisions{0};
pdns::stat_t d_lookupCollisions{0};
pdns::stat_t d_ttlTooShorts{0};
+ pdns::stat_t d_cleanupCount{0};
size_t d_maxEntries;
uint32_t d_shardCount;
str<<base<<"cache-lookup-collisions" << " " << cache->getLookupCollisions() << " " << now << "\r\n";
str<<base<<"cache-insert-collisions" << " " << cache->getInsertCollisions() << " " << now << "\r\n";
str<<base<<"cache-ttl-too-shorts" << " " << cache->getTTLTooShorts() << " " << now << "\r\n";
+ str<<base<<"cache-cleanup-count" << " " << cache->getCleanupCount() << " " << now << "\r\n";
}
}
output << cachebase << "cache_lookup_collisions" <<label << " " << cache->getLookupCollisions() << "\n";
output << cachebase << "cache_insert_collisions" <<label << " " << cache->getInsertCollisions() << "\n";
output << cachebase << "cache_ttl_too_shorts" <<label << " " << cache->getTTLTooShorts() << "\n";
+ output << cachebase << "cache_cleanup_count" <<label << " " << cache->getCleanupCount() << "\n";
}
}
{ "cacheDeferredLookups", (double) (cache ? cache->getDeferredLookups() : 0) },
{ "cacheLookupCollisions", (double) (cache ? cache->getLookupCollisions() : 0) },
{ "cacheInsertCollisions", (double) (cache ? cache->getInsertCollisions() : 0) },
- { "cacheTTLTooShorts", (double) (cache ? cache->getTTLTooShorts() : 0) }
+ { "cacheTTLTooShorts", (double) (cache ? cache->getTTLTooShorts() : 0) },
+ { "cacheCleanupCount", (double) (cache ? cache->getCleanupCount() : 0) }
};
pools.push_back(entry);
}
{ "cacheDeferredLookups", (double) (cache ? cache->getDeferredLookups() : 0) },
{ "cacheLookupCollisions", (double) (cache ? cache->getLookupCollisions() : 0) },
{ "cacheInsertCollisions", (double) (cache ? cache->getInsertCollisions() : 0) },
- { "cacheTTLTooShorts", (double) (cache ? cache->getTTLTooShorts() : 0) }
+ { "cacheTTLTooShorts", (double) (cache ? cache->getTTLTooShorts() : 0) },
+ { "cacheCleanupCount", (double) (cache ? cache->getCleanupCount() : 0) }
};
Json::array servers;
g_outputBuffer+="Lookup Collisions: " + std::to_string(cache->getLookupCollisions()) + "\n";
g_outputBuffer+="Insert Collisions: " + std::to_string(cache->getInsertCollisions()) + "\n";
g_outputBuffer+="TTL Too Shorts: " + std::to_string(cache->getTTLTooShorts()) + "\n";
+ g_outputBuffer+="Cleanup Count: " + std::to_string(cache->getCleanupCount()) + "\n";
}
});
luaCtx.registerFunction<LuaAssociativeTable<uint64_t>(std::shared_ptr<DNSDistPacketCache>::*)()const>("getStats", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
stats["lookupCollisions"] = cache->getLookupCollisions();
stats["insertCollisions"] = cache->getInsertCollisions();
stats["ttlTooShorts"] = cache->getTTLTooShorts();
+ stats["cleanupCount"] = cache->getCleanupCount();
}
return stats;
});