]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Include all rec threads for CPU usage stats
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 30 Aug 2023 13:15:30 +0000 (15:15 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 13 Sep 2023 11:20:54 +0000 (13:20 +0200)
pdns/recursordist/rec_channel_rec.cc

index b69a96e081cf8cca6ed8b9c18c7ef146aa189ff2..2373e5f802692dfdfaad9d3389a2e8b3715fc6af 100644 (file)
@@ -1189,9 +1189,9 @@ static StatsMap toCPUStatsMap(const string& name)
 {
   const string pbasename = getPrometheusName(name);
   StatsMap entries;
-  // Only distr and worker threads, I think we should revisit this as we now not only have the handler thread but also
-  // taskThread(s).
-  for (unsigned int n = 0; n < RecThreadInfo::numDistributors() + RecThreadInfo::numWorkers(); ++n) {
+
+  // Handler is not reported
+  for (unsigned int n = 0; n < RecThreadInfo::numRecursorThreads() - 1; ++n) {
     uint64_t tm = doGetThreadCPUMsec(n);
     std::string pname = pbasename + "{thread=\"" + std::to_string(n) + "\"}";
     entries.emplace(name + "-thread-" + std::to_string(n), StatsMapEntry{std::move(pname), std::to_string(tm)});