From 448a991404565878c0a6517a03c84e0624673402 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 14 Aug 2019 17:22:27 +0200 Subject: [PATCH] Expose metric current_pending_callbacks --- lib/icinga/cib.cpp | 2 ++ lib/methods/icingachecktask.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/icinga/cib.cpp b/lib/icinga/cib.cpp index b378bcd6f..555079ec9 100644 --- a/lib/icinga/cib.cpp +++ b/lib/icinga/cib.cpp @@ -4,6 +4,7 @@ #include "icinga/host.hpp" #include "icinga/service.hpp" #include "icinga/clusterevents.hpp" +#include "base/application.hpp" #include "base/objectlock.hpp" #include "base/utility.hpp" #include "base/perfdatavalue.hpp" @@ -292,6 +293,7 @@ void CIB::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) { // Checker related stats status->Set("remote_check_queue", ClusterEvents::GetCheckRequestQueueSize()); status->Set("current_concurrent_checks", Checkable::GetPendingChecks()); + status->Set("current_pending_callbacks", Application::GetTP().GetPending()); CheckableCheckStatistics scs = CalculateServiceCheckStats(); diff --git a/lib/methods/icingachecktask.cpp b/lib/methods/icingachecktask.cpp index e67d1ff94..4b7d0da01 100644 --- a/lib/methods/icingachecktask.cpp +++ b/lib/methods/icingachecktask.cpp @@ -75,6 +75,7 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes perfdata->Add(new PerfdataValue("active_service_checks_15min", CIB::GetActiveServiceChecksStatistics(60 * 15))); perfdata->Add(new PerfdataValue("passive_service_checks_15min", CIB::GetPassiveServiceChecksStatistics(60 * 15))); + perfdata->Add(new PerfdataValue("current_pending_callbacks", Application::GetTP().GetPending())); perfdata->Add(new PerfdataValue("current_concurrent_checks", Checkable::GetPendingChecks())); perfdata->Add(new PerfdataValue("remote_check_queue", ClusterEvents::GetCheckRequestQueueSize()));