File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
2
3
+ #include " remote/apifunction.hpp"
3
4
#include " remote/endpoint.hpp"
4
5
#include " remote/endpoint-ti.cpp"
5
6
#include " remote/apilistener.hpp"
@@ -136,3 +137,17 @@ double Endpoint::GetBytesReceivedPerSecond() const
136
137
{
137
138
return m_BytesReceived.CalculateRate (Utility::GetTime (), 60 );
138
139
}
140
+
141
+ Dictionary::Ptr Endpoint::GetMessagesReceivedPerType () const
142
+ {
143
+ DictionaryData result;
144
+
145
+ {
146
+ std::shared_lock sLock (m_MessageCountersMutex);
147
+
148
+ for (auto & [afunc, cnt] : m_MessageCounters)
149
+ result.emplace_back (afunc->GetName (), cnt.load (std::memory_order_relaxed));
150
+ }
151
+
152
+ return new Dictionary (std::move (result));
153
+ }
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ class Endpoint final : public ObjectImpl<Endpoint>
56
56
double GetBytesSentPerSecond () const override ;
57
57
double GetBytesReceivedPerSecond () const override ;
58
58
59
+ Dictionary::Ptr GetMessagesReceivedPerType () const override ;
60
+
59
61
protected:
60
62
void OnAllConfigLoaded () override ;
61
63
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ class Endpoint : ConfigObject
54
54
[no_user_modify, no_storage] double bytes_received_per_second {
55
55
get;
56
56
};
57
+
58
+ [no_user_modify, no_storage] Dictionary::Ptr messages_received_per_type {
59
+ get;
60
+ };
57
61
};
58
62
59
63
}
You can’t perform that action at this time.
0 commit comments