# TYPE pdns_auth_packetcache_miss counter
pdns_auth_packetcache_miss 0
# HELP pdns_auth_packetcache_size Number of entries in the packet cache
- # TYPE pdns_auth_packetcache_size counter
+ # TYPE pdns_auth_packetcache_size gauge
pdns_auth_packetcache_size 0
# HELP pdns_auth_query_cache_hit Number of hits on the query cache
# TYPE pdns_auth_query_cache_hit counter
# TYPE pdns_auth_query_cache_miss counter
pdns_auth_query_cache_miss 0
# HELP pdns_auth_query_cache_size Number of entries in the query cache
- # TYPE pdns_auth_query_cache_size counter
+ # TYPE pdns_auth_query_cache_size gauge
pdns_auth_query_cache_size 0
# HELP pdns_auth_rd_queries Number of recursion desired questions
# TYPE pdns_auth_rd_queries counter
# TYPE pdns_auth_recursion_unanswered counter
pdns_auth_recursion_unanswered 0
# HELP pdns_auth_security_status Security status based on regular polling
- # TYPE pdns_auth_security_status counter
+ # TYPE pdns_auth_security_status gauge
pdns_auth_security_status 0
# HELP pdns_auth_servfail_packets Number of times a server-failed packet was sent out
# TYPE pdns_auth_servfail_packets counter
{
S.declare("packetcache-hit", "Number of hits on the packet cache");
S.declare("packetcache-miss", "Number of misses on the packet cache");
- S.declare("packetcache-size", "Number of entries in the packet cache");
+ S.declare("packetcache-size", "Number of entries in the packet cache", StatType::gauge);
S.declare("deferred-packetcache-inserts","Amount of packet cache inserts that were deferred because of maintenance");
S.declare("deferred-packetcache-lookup","Amount of packet cache lookups that were deferred because of maintenance");
{
S.declare("query-cache-hit","Number of hits on the query cache");
S.declare("query-cache-miss","Number of misses on the query cache");
- S.declare("query-cache-size", "Number of entries in the query cache");
+ S.declare("query-cache-size", "Number of entries in the query cache", StatType::gauge);
S.declare("deferred-cache-inserts","Amount of cache inserts that were deferred because of maintenance");
S.declare("deferred-cache-lookup","Amount of cache lookups that were deferred because of maintenance");
S.declare("servfail-packets","Number of times a server-failed packet was sent out");
S.declare("latency","Average number of microseconds needed to answer a question", getLatency, StatType::gauge);
S.declare("timedout-packets","Number of packets which weren't answered within timeout set");
- S.declare("security-status", "Security status based on regular polling");
+ S.declare("security-status", "Security status based on regular polling", StatType::gauge);
S.declareDNSNameQTypeRing("queries","UDP Queries Received");
S.declareDNSNameQTypeRing("nxdomain-queries","Queries for non-existent records within existent domains");
S.declareDNSNameQTypeRing("noerror-queries","Queries for existing records, but for type we don't have");
return d_statTypes[item];
}
-void StatBag::declare(const string &key, const string &descrip)
+void StatBag::declare(const string &key, const string &descrip, StatType statType)
{
auto i=make_unique<AtomicCounter>(0);
d_stats[key]=std::move(i);
d_keyDescrips[key]=descrip;
- d_statTypes[key]=StatType::counter;
+ d_statTypes[key]=statType;
}
void StatBag::declare(const string &key, const string &descrip, StatBag::func_t func, StatType statType)
public:
StatBag(); //!< Naked constructor. You need to declare keys before this class becomes useful
~StatBag();
- void declare(const string &key, const string &descrip=""); //!< Before you can store or access a key, you need to declare it
+ void declare(const string &key, const string &descrip="", StatType statType=StatType::counter); //!< Before you can store or access a key, you need to declare it
void declare(const string &key, const string &descrip, func_t func, StatType statType); //!< Before you can store or access a key, you need to declare it
void declareRing(const string &name, const string &title, unsigned int size=10000);