]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Add steal and IO wait metrics
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 3 Feb 2020 10:51:35 +0000 (11:51 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 5 Feb 2020 09:40:42 +0000 (10:40 +0100)
pdns/rec_channel_rec.cc
pdns/recursordist/docs/metrics.rst
pdns/recursordist/rec_metrics.hh

index 5acc4185190ae82f909968e4a65f947cbc1e2951..2e0e96adb8dd20ab6731352d2c51da6683fb7657 100644 (file)
@@ -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));
 
index de0e6eddd1095723ab7b4ad4ac2060a8da863bb3..52e7f9cc8fbeea104f9c3e2402392bf0c6af90bd 100644 (file)
@@ -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
index 5ad436aa312b4301d26fd1e0237fc192116084e4..3c6d7d78399d95ccbbe91398b5ab00ed0ffedc37 100644 (file)
@@ -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")},
   };
 };