From: Remi Gacogne Date: Mon, 3 Feb 2020 10:51:35 +0000 (+0100) Subject: rec: Add steal and IO wait metrics X-Git-Tag: auth-4.3.0-beta2~28^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e27f874790a07bff20b0b93c4a62920ce001b27;p=thirdparty%2Fpdns.git rec: Add steal and IO wait metrics --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 5acc418519..2e0e96adb8 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -1162,6 +1162,11 @@ void registerAllStats() addGetStat("user-msec", getUserTimeMsec); addGetStat("sys-msec", getSysTimeMsec); +#ifdef __linux__ + addGetStat("cpu-iowait", boost::bind(getCPUIOWait, string())); + addGetStat("cpu-steal", boost::bind(getCPUSteal, string())); +#endif + for(unsigned int n=0; n < g_numThreads; ++n) addGetStat("cpu-msec-thread-"+std::to_string(n), boost::bind(&doGetThreadCPUMsec, n)); diff --git a/pdns/recursordist/docs/metrics.rst b/pdns/recursordist/docs/metrics.rst index de0e6eddd1..52e7f9cc8f 100644 --- a/pdns/recursordist/docs/metrics.rst +++ b/pdns/recursordist/docs/metrics.rst @@ -189,6 +189,18 @@ cpu-msec-thread-n ^^^^^^^^^^^^^^^^^ shows the number of milliseconds spent in thread n. Available since 4.1.12. +cpu-iowait +^^^^^^^^^^ +.. versionadded:: 4.4 + +Time spent waiting for I/O to complete by the whole system. + +cpu-steal +^^^^^^^^^ +.. versionadded:: 4.4 + +Stolen time, which is the time spent by the whole system in other operating systems when running in a virtualized environment. + dlg-only-drops ^^^^^^^^^^^^^^ number of records dropped because of :ref:`setting-delegation-only` setting diff --git a/pdns/recursordist/rec_metrics.hh b/pdns/recursordist/rec_metrics.hh index 5ad436aa31..3c6d7d7839 100644 --- a/pdns/recursordist/rec_metrics.hh +++ b/pdns/recursordist/rec_metrics.hh @@ -441,6 +441,13 @@ private: {"udp-sndbuf-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp SndbufErrors")}, + + {"cpu-iowait", + MetricDefinition(PrometheusMetricType::counter, + "Time spent waiting for I/O to complete by the whole system")}, + {"cpu-steal", + MetricDefinition(PrometheusMetricType::counter, + "Stolen time, which is the time spent by the whole system in other operating systems when running in a virtualized environment")}, }; };