mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-29 08:34:20 +02:00
Introduce Endpoint#messages_received_per_type
This commit is contained in:
parent
dd9e211927
commit
712d39740f
@ -149,3 +149,16 @@ double Endpoint::GetBytesReceivedPerSecond() const
|
||||
{
|
||||
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 GetBytesReceivedPerSecond() const override;
|
||||
|
||||
Dictionary::Ptr GetMessagesReceivedPerType() const override;
|
||||
|
||||
protected:
|
||||
void OnAllConfigLoaded() override;
|
||||
|
||||
|
@ -54,6 +54,10 @@ class Endpoint : ConfigObject
|
||||
[no_user_modify, no_storage] double bytes_received_per_second {
|
||||
get;
|
||||
};
|
||||
|
||||
[no_user_modify, no_storage] Dictionary::Ptr messages_received_per_type {
|
||||
get;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user