mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-29 16:44:29 +02:00
Introduce Endpoint#messages_received_per_type
This commit is contained in:
parent
3dd7b15808
commit
98d097517b
@ -149,3 +149,16 @@ double Endpoint::GetBytesReceivedPerSecond() const
|
|||||||
{
|
{
|
||||||
return m_BytesReceived.CalculateRate(Utility::GetTime(), 60);
|
return m_BytesReceived.CalculateRate(Utility::GetTime(), 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dictionary::Ptr Endpoint::GetMessagesReceivedPerType() const
|
||||||
|
{
|
||||||
|
DictionaryData result;
|
||||||
|
|
||||||
|
for (auto& [afunc, cnt] : m_MessageCounters) {
|
||||||
|
if (auto v (cnt.load(std::memory_order_relaxed)); v) {
|
||||||
|
result.emplace_back(afunc->GetName(), v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Dictionary(std::move(result));
|
||||||
|
}
|
||||||
|
@ -56,6 +56,8 @@ public:
|
|||||||
double GetBytesSentPerSecond() const override;
|
double GetBytesSentPerSecond() const override;
|
||||||
double GetBytesReceivedPerSecond() const override;
|
double GetBytesReceivedPerSecond() const override;
|
||||||
|
|
||||||
|
Dictionary::Ptr GetMessagesReceivedPerType() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void OnAllConfigLoaded() override;
|
void OnAllConfigLoaded() override;
|
||||||
|
|
||||||
|
@ -54,6 +54,10 @@ class Endpoint : ConfigObject
|
|||||||
[no_user_modify, no_storage] double bytes_received_per_second {
|
[no_user_modify, no_storage] double bytes_received_per_second {
|
||||||
get;
|
get;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[no_user_modify, no_storage] Dictionary::Ptr messages_received_per_type {
|
||||||
|
get;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user