From: Otto Moerbeek Date: Wed, 30 Aug 2023 13:15:30 +0000 (+0200) Subject: Include all rec threads for CPU usage stats X-Git-Tag: rec-5.0.0-alpha2~58^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6be3251cafac6e963500435f56c57c31dbb85644;p=thirdparty%2Fpdns.git Include all rec threads for CPU usage stats --- diff --git a/pdns/recursordist/rec_channel_rec.cc b/pdns/recursordist/rec_channel_rec.cc index b69a96e081..2373e5f802 100644 --- a/pdns/recursordist/rec_channel_rec.cc +++ b/pdns/recursordist/rec_channel_rec.cc @@ -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)});