static const oid sourceDisallowedNotifyOID[] = {RECURSOR_STATS_OID, 124};
static const oid zoneDisallowedNotifyOID[] = {RECURSOR_STATS_OID, 125};
static const oid nonResolvingNameserverEntriesOID[] = {RECURSOR_STATS_OID, 126};
+static const oid maintenanceUSecOID[] = {RECURSOR_STATS_OID, 127};
+static const oid maintenanceCallsOID[] = {RECURSOR_STATS_OID, 128};
static std::unordered_map<oid, std::string> s_statsMap;
registerCounter64Stat("almost-expired-run", almostExpiredRun, OID_LENGTH(almostExpiredRun));
registerCounter64Stat("almost-expired-exceptions", almostExpiredExceptions, OID_LENGTH(almostExpiredExceptions));
registerCounter64Stat("non-resolving-nameserver-entries", nonResolvingNameserverEntriesOID, OID_LENGTH(nonResolvingNameserverEntriesOID));
+ registerCounter64Stat("maintenance-usec", maintenanceUSecOID, OID_LENGTH(maintenanceUSecOID));
+ registerCounter64Stat("maintenance-calls", maintenanceCountOID, OID_LENGTH(maintenanceCallsOID));
#endif /* HAVE_NET_SNMP */
}
addGetStat("idle-tcpout-connections", getCurrentIdleTCPConnections);
+ addGetStat("maintenance-usec", &g_stats.maintenanceUsec);
+ addGetStat("maintenance-calls", &g_stats.maintenanceCalls);
+
/* make sure that the ECS stats are properly initialized */
SyncRes::clearECSStats();
for (size_t idx = 0; idx < SyncRes::s_ecsResponsesBySubnetSize4.size(); idx++) {
REVISION "202201310000Z"
DESCRIPTION "Added non-resolving NS name metric."
+ REVISION "202208220000Z"
+ DESCRIPTION "Added internal maintenance metrics."
+
::= { powerdns 2 }
powerdns OBJECT IDENTIFIER ::= { enterprises 43315 }
udp6InCsumErrors,
sourceDisallowedNotify,
zoneDisallowedNotify,
- nonResolvingNameserverEntries
+ nonResolvingNameserverEntries,
+ maintenanceUSec,
+ maintenanceCalls
}
STATUS current
DESCRIPTION "Objects conformance group for PowerDNS Recursor"
^^^^^^^^^^^^^^
counts all end-user initiated queries with the RD bit set, received over IPv6 UDP
+maintenance-usec
+^^^^^^^^^^^^^^^^
+time spent doing internal maintenance, including Lua maintenance
+
+maintenance-calls
+^^^^^^^^^^^^^^^^^
+number of times internal maintenance has been called, including Lua maintenance
+
malloc-bytes
^^^^^^^^^^^^
returns the number of bytes allocated by the process (broken, always returns 0)
// Use primes, it avoid not being scheduled in cases where the counter has a regular pattern.
// We want to call handler thread often, it gets scheduled about 2 times per second
if (((threadInfo.isHandler() || threadInfo.isTaskThread()) && s_counter % 11 == 0) || s_counter % 499 == 0) {
+ struct timeval start;
+ Utility::gettimeofday(&start);
MT->makeThread(houseKeeping, nullptr);
+ if (!threadInfo.isTaskThread()) {
+ struct timeval stop;
+ Utility::gettimeofday(&stop);
+ g_stats.maintenanceUsec += uSec(stop - start);
+ ++g_stats.maintenanceCalls;
+ }
}
if (!(s_counter % 55)) {
if (threadInfo.isWorker() || threadInfo.isListener()) {
// Only on threads processing queries
if (g_now.tv_sec - last_lua_maintenance >= luaMaintenanceInterval) {
+ struct timeval start;
+ Utility::gettimeofday(&start);
t_pdl->maintenance();
last_lua_maintenance = g_now.tv_sec;
+ struct timeval stop;
+ Utility::gettimeofday(&stop);
+ g_stats.maintenanceUsec += uSec(stop - start);
+ ++g_stats.maintenanceCalls;
}
}
}
pdns::stat_t proxyProtocolInvalidCount{0};
pdns::stat_t nodLookupsDroppedOversize{0};
pdns::stat_t dns64prefixanswers{0};
+ pdns::stat_t maintenanceUsec{0};
+ pdns::stat_t maintenanceCalls{0};
RecursorStats() :
answers("answers", { 1000, 10000, 100000, 1000000 }),
MetricDefinition(PrometheusMetricType::gauge,
"Number of connections in the TCP idle outgoing connections pool")},
+ {"maintenance-usec",
+ MetricDefinition(PrometheusMetricType::counter,
+ "Time spent doing internal maintenance, including Lua maintenance")},
+
+ {"maintenance-calls",
+ MetricDefinition(PrometheusMetricType::counter,
+ "Number of times internal maintenance has been called, including Lua maintenance")},
};
#define CHECK_PROMETHEUS_METRICS 0