diff --git a/lib/methods/clusterzonechecktask.cpp b/lib/methods/clusterzonechecktask.cpp index d7c99138c..c467621d3 100644 --- a/lib/methods/clusterzonechecktask.cpp +++ b/lib/methods/clusterzonechecktask.cpp @@ -137,6 +137,9 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che double messagesReceivedPerSecond = 0; double bytesSentPerSecond = 0; double bytesReceivedPerSecond = 0; + double secondsReadingMessages = 0; + double secondsAwaitingSemaphore = 0; + double secondsProcessingMessages = 0; { auto endpoints (zone->GetEndpoints()); @@ -160,6 +163,9 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che messagesReceivedPerSecond += endpoint->GetMessagesReceivedPerSecond(); bytesSentPerSecond += endpoint->GetBytesSentPerSecond(); bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond(); + secondsReadingMessages += endpoint->GetSecondsReadingMessages(); + secondsAwaitingSemaphore += endpoint->GetSecondsAwaitingSemaphore(); + secondsProcessingMessages += endpoint->GetSecondsProcessingMessages(); } if (!connected && endpoints.size() == 1u && *endpoints.begin() == Endpoint::GetLocalEndpoint()) { @@ -210,7 +216,10 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che new PerfdataValue("sum_messages_sent_per_second", messagesSentPerSecond), new PerfdataValue("sum_messages_received_per_second", messagesReceivedPerSecond), new PerfdataValue("sum_bytes_sent_per_second", bytesSentPerSecond), - new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond) + new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond), + new PerfdataValue("sum_seconds_reading_messages", secondsReadingMessages, true), + new PerfdataValue("sum_seconds_awaiting_semaphore", secondsAwaitingSemaphore, true), + new PerfdataValue("sum_seconds_processing_messages", secondsProcessingMessages, true), })); checkable->ProcessCheckResult(cr, producer); diff --git a/lib/methods/icingachecktask.cpp b/lib/methods/icingachecktask.cpp index 3a8e9fbce..e56268f81 100644 --- a/lib/methods/icingachecktask.cpp +++ b/lib/methods/icingachecktask.cpp @@ -127,6 +127,9 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes double messagesReceivedPerSecond = 0; double bytesSentPerSecond = 0; double bytesReceivedPerSecond = 0; + double secondsReadingMessages = 0; + double secondsAwaitingSemaphore = 0; + double secondsProcessingMessages = 0; for (const Endpoint::Ptr& endpoint : endpoints) { @@ -140,6 +143,9 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes messagesReceivedPerSecond += endpoint->GetMessagesReceivedPerSecond(); bytesSentPerSecond += endpoint->GetBytesSentPerSecond(); bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond(); + secondsReadingMessages += endpoint->GetSecondsReadingMessages(); + secondsAwaitingSemaphore += endpoint->GetSecondsAwaitingSemaphore(); + secondsProcessingMessages += endpoint->GetSecondsProcessingMessages(); } perfdata->Add(new PerfdataValue("last_messages_sent", lastMessageSent)); @@ -148,6 +154,9 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes perfdata->Add(new PerfdataValue("sum_messages_received_per_second", messagesReceivedPerSecond)); perfdata->Add(new PerfdataValue("sum_bytes_sent_per_second", bytesSentPerSecond)); perfdata->Add(new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond)); + perfdata->Add(new PerfdataValue("sum_seconds_reading_messages", secondsReadingMessages, true)); + perfdata->Add(new PerfdataValue("sum_seconds_awaiting_semaphore", secondsAwaitingSemaphore, true)); + perfdata->Add(new PerfdataValue("sum_seconds_processing_messages", secondsProcessingMessages, true)); cr->SetPerformanceData(perfdata); ServiceState state = ServiceOK; diff --git a/lib/remote/endpoint.cpp b/lib/remote/endpoint.cpp index 42a5a5af1..679c47ca4 100644 --- a/lib/remote/endpoint.cpp +++ b/lib/remote/endpoint.cpp @@ -162,3 +162,18 @@ Dictionary::Ptr Endpoint::GetMessagesReceivedPerType() const return new Dictionary(std::move(result)); } + +double Endpoint::GetSecondsReadingMessages() const +{ + return m_InputReadTime; +} + +double Endpoint::GetSecondsAwaitingSemaphore() const +{ + return m_InputSemaphoreTime; +} + +double Endpoint::GetSecondsProcessingMessages() const +{ + return m_InputProcessTime; +} diff --git a/lib/remote/endpoint.hpp b/lib/remote/endpoint.hpp index 7a03e1fd9..7987d9b91 100644 --- a/lib/remote/endpoint.hpp +++ b/lib/remote/endpoint.hpp @@ -65,6 +65,10 @@ public: Dictionary::Ptr GetMessagesReceivedPerType() const override; + double GetSecondsReadingMessages() const override; + double GetSecondsAwaitingSemaphore() const override; + double GetSecondsProcessingMessages() const override; + protected: void OnAllConfigLoaded() override; diff --git a/lib/remote/endpoint.ti b/lib/remote/endpoint.ti index 2fa874b5e..b2bd62f6b 100644 --- a/lib/remote/endpoint.ti +++ b/lib/remote/endpoint.ti @@ -58,6 +58,18 @@ class Endpoint : ConfigObject [no_user_modify, no_storage] Dictionary::Ptr messages_received_per_type { get; }; + + [no_user_modify, no_storage] double seconds_reading_messages { + get; + }; + + [no_user_modify, no_storage] double seconds_awaiting_semaphore { + get; + }; + + [no_user_modify, no_storage] double seconds_processing_messages { + get; + }; }; }