EpcTools
An event based multi-threaded C++ development framework.
estats.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2019 Sprint
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17 #ifndef __ESTATS_H
18 #define __ESTATS_H
19 
23 
24 #include <atomic>
25 #include <unordered_map>
26 
27 #include "ebase.h"
28 #include "eerror.h"
29 #include "efd.h"
30 #include "elogger.h"
31 #include "estring.h"
32 #include "etime.h"
33 #include "esynch.h"
34 
35 //
36 // According to IANA, the current diameter application ID range is from 0 to 16777361.
37 // Diameter application ID's start at 0 and appear to be "reserved" through 16777215 (0x00FFFFFF).
38 // 3GPP diameter applications ID's appear to have the low order bit of the high order word set to 1 (16777216 decimal or 0x1000000 hex).
39 //
41 #define GTPV2C_BASE (0xff000000)
42 #define GTPV1U_BASE (0xfe000000)
43 #define PFCP_BASE (0xfd000000)
44 
45 const UInt INTERFACE_S11C = (GTPV2C_BASE + 1);
46 const UInt INTERFACE_S5S8C = (GTPV2C_BASE + 2);
47 const UInt INTERFACE_S4 = (GTPV2C_BASE + 3);
48 const UInt INTERFACE_S2b = (GTPV2C_BASE + 4);
49 
50 const UInt INTERFACE_S1U = (GTPV1U_BASE + 1);
51 const UInt INTERFACE_S11U = (GTPV1U_BASE + 2);
52 const UInt INTERFACE_S5S8U = (GTPV1U_BASE + 3);
53 const UInt INTERFACE_SWu = (GTPV1U_BASE + 4);
54 
55 const UInt INTERFACE_Sxa = (PFCP_BASE + 1);
56 const UInt INTERFACE_Sxb = (PFCP_BASE + 2);
57 const UInt INTERFACE_Sxc = (PFCP_BASE + 3);
58 const UInt INTERFACE_SxaSxb = (PFCP_BASE + 4);
59 
60 const UInt DIAMETER_ANSWER_BIT = 0x80000000;
62 
64 {
65 public:
66  enum class ProtocolType
67  {
68  diameter,
69  gtpv2c,
70  gtpv1u,
71  pfcp,
72  ikev2
73  };
74 
75  typedef UInt InterfaceId;
76  typedef UInt MessageId;
77 
80  class DiameterHook : public FDHook
81  {
82  public:
84  DiameterHook()
85  : m_logger( NULL )
86  {
87  }
88 
89  Void process(enum fd_hook_type type, struct msg * msg, struct peer_hdr * peer,
90  Void * other, struct fd_hook_permsgdata *pmd);
91 
92  Void setLogger(ELogger &logger) { m_logger = &logger; }
94 
95  private:
96  Bool getResult(struct msg *m);
97 
98  ELogger *m_logger;
99  };
100 
103  {
104  public:
105  MessageStats(EStatistics::MessageId id, cpStr name);
107  MessageStats(const MessageStats &m);
108 
109  Void reset();
110 
111  EStatistics::MessageId getId() { return m_id; }
112  const EString &getName() { return m_name; }
113 
116  UInt getRequestSentErrors() { return m_rqst_sent_err; }
119  UInt getRequestReceivedErrors() { return m_rqst_rcvd_err; }
122  UInt getRequestSentOk() { return m_rqst_sent_ok; }
125  UInt getRequestReceivedOk() { return m_rqst_rcvd_ok; }
126 
129  UInt getResponseSentErrors() { return m_resp_sent_err; }
132  UInt getResponseReceivedErrors() { return m_resp_rcvd_err; }
135  UInt getResponseSentOkAccepted() { return m_resp_sent_accept; }
138  UInt getResponseSentOkRejected() { return m_resp_sent_reject; }
141  UInt getResponseReceivedOkAccepted() { return m_resp_rcvd_accept; }
144  UInt getResponseReceivedOkRejected() { return m_resp_rcvd_reject; }
145 
148  UInt incRequestSentErrors() { return ++m_rqst_sent_err; }
151  UInt incRequestReceivedErrors() { return ++m_rqst_rcvd_err; }
154  UInt incRequestSentOk() { return ++m_rqst_sent_ok; }
157  UInt incRequestReceivedOk() { return ++m_rqst_rcvd_ok; }
158 
161  UInt incResponseSentErrors() { return ++m_resp_sent_err; }
164  UInt incResponseReceivedErrors() { return ++m_resp_rcvd_err; }
167  UInt incResponseSentOkAccepted() { return ++m_resp_sent_accept; }
170  UInt incResponseSentOkRejected() { return ++m_resp_sent_reject; }
173  UInt incResponseReceivedOkAccepted() { return ++m_resp_rcvd_accept; }
176  UInt incResponseReceivedOkRejected() { return ++m_resp_rcvd_reject; }
177 
178  private:
179  MessageStats();
180 
182  EString m_name;
183 
184  std::atomic<UInt> m_rqst_sent_err;
185  std::atomic<UInt> m_rqst_rcvd_err;
186  std::atomic<UInt> m_rqst_sent_ok;
187  std::atomic<UInt> m_rqst_rcvd_ok;
188 
189  std::atomic<UInt> m_resp_sent_err;
190  std::atomic<UInt> m_resp_rcvd_err;
191  std::atomic<UInt> m_resp_sent_accept;
192  std::atomic<UInt> m_resp_sent_reject;
193  std::atomic<UInt> m_resp_rcvd_accept;
194  std::atomic<UInt> m_resp_rcvd_reject;
195  };
196 
197  typedef std::unordered_map<EStatistics::MessageId,EStatistics::MessageStats> MessageStatsMap;
198 
200  class Peer
201  {
202  public:
206  Peer(cpStr name, const EStatistics::MessageStatsMap &tmplt);
210  Peer(const EString &name, const EStatistics::MessageStatsMap &tmplt);
213  Peer(const Peer &p);
214 
218 
221  EString &getName() { return m_name; }
224  ETime &getLastActivity() { return m_lastactivity; }
227  ETime &setLastActivity() { return m_lastactivity = ETime::Now(); }
232  Void reset();
233 
235  #define INCREMENT_MESSAGE_STAT(__id,__func) \
236  { \
237  auto srch = m_msgstats.find(__id); \
238  if (srch == m_msgstats.end() ) \
239  return 0; \
240  setLastActivity(); \
241  return srch->second.__func(); \
242  }
243 
248  UInt incRequestSentErrors(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incRequestSentErrors); }
252  UInt incRequestReceivedErrors(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incRequestReceivedErrors); }
256  UInt incRequestSentOk(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incRequestSentOk); }
260  UInt incRequestReceivedOk(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incRequestReceivedOk); }
261 
265  UInt incResponseSentErrors(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incResponseSentErrors); }
269  UInt incResponseReceivedErrors(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incResponseReceivedErrors); }
273  UInt incResponseSentOkAccepted(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incResponseSentOkAccepted); }
277  UInt incResponseSentOkRejected(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incResponseSentOkRejected); }
281  UInt incResponseReceivedOkAccepted(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incResponseReceivedOkAccepted); }
285  UInt incResponseReceivedOkRejected(UInt msgid) { INCREMENT_MESSAGE_STAT(msgid, incResponseReceivedOkRejected); }
286 
288  #undef INCREMENT_MESSAGE_STAT
289 
291  private:
292  EString m_name;
293  ETime m_lastactivity;
294  ERWLock m_lock;
295  EStatistics::MessageStatsMap m_msgstats;
296  };
298  typedef std::unordered_map<std::string,EStatistics::Peer> PeerMap;
299 
301  class Interface
302  {
303  public:
316  Interface(const Interface &i);
317 
320  EStatistics::InterfaceId getId() { return m_id; }
323  EString &getName() { return m_name; }
326  ProtocolType getProtocol() { return m_protocol; }
329  PeerMap &getPeers() { return m_peers; }
330 
333  Peer &getPeer(const EString &peer, Bool addFlag = True);
336  Peer &addPeer(const EString &peer);
338  Void removePeer(const EString &peer);
340  Void reset();
341 
347  MessageStatsMap &getMessageStatsTemplate() { return m_msgstats_template; }
348 
350  #define INCREMENT_MESSAGE_STAT(__peer,__id,__func) \
351  { \
352  EStatistics::Peer &__p( getPeer(__peer) ); \
353  return __p.__func(__id); \
354  }
355 
361  UInt incRequestSentErrors(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incRequestSentErrors); }
366  UInt incRequestReceivedErrors(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incRequestReceivedErrors); }
371  UInt incRequestSentOk(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incRequestSentOk); }
376  UInt incRequestReceivedOk(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incRequestReceivedOk); }
377 
382  UInt incResponseSentErrors(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incResponseSentErrors); }
387  UInt incResponseReceivedErrors(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incResponseReceivedErrors); }
392  UInt incResponseSentOkAccepted(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incResponseSentOkAccepted); }
397  UInt incResponseSentOkRejected(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incResponseSentOkRejected); }
402  UInt incResponseReceivedOkAccepted(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incResponseReceivedOkAccepted); }
407  UInt incResponseReceivedOkRejected(cpStr peer, UInt msgid) { EString p(peer); INCREMENT_MESSAGE_STAT(p, msgid, incResponseReceivedOkRejected); }
408 
413  UInt incRequestSentErrors(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incRequestSentErrors); }
418  UInt incRequestReceivedErrors(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incRequestReceivedErrors); }
423  UInt incRequestSentOk(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incRequestSentOk); }
428  UInt incRequestReceivedOk(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incRequestReceivedOk); }
429 
434  UInt incResponseSentErrors(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incResponseSentErrors); }
439  UInt incResponseReceivedErrors(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incResponseReceivedErrors); }
444  UInt incResponseSentOkAccepted(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incResponseSentOkAccepted); }
449  UInt incResponseSentOkRejected(const std::string &peer, Int msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incResponseSentOkRejected); }
454  UInt incResponseReceivedOkAccepted(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incResponseReceivedOkAccepted); }
459  UInt incResponseReceivedOkRejected(const std::string &peer, UInt msgid) { INCREMENT_MESSAGE_STAT(peer, msgid, incResponseReceivedOkRejected); }
460 
462  #undef INCREMENT_MESSAGE_STAT
463 
465  private:
466  Interface();
467 
468  Peer &_addPeer(const EString &peer);
469 
471  ProtocolType m_protocol;
472  EString m_name;
473  ERWLock m_lock;
474  PeerMap m_peers;
475  MessageStatsMap m_msgstats_template;
476  };
477  typedef std::unordered_map<EStatistics::InterfaceId,EStatistics::Interface> InterfaceMap;
478 
484  {
485  ERDLock l(m_lock);
486  auto srch = m_interfaces.find(id);
487  if (srch == m_interfaces.end())
488  {
489  EString s;
490  s.format("Unknown interface ID [%u]", id);
491  throw EError(EError::Warning, s);
492  }
493  return srch->second;
494  }
495 
502  {
503  EWRLock l(m_lock);
504  auto it = m_interfaces.emplace(id, Interface(id,protocol,intfc));
505  return it.first->second;
506  }
507 
511  {
512  EWRLock l(m_lock);
513  auto srch = m_interfaces.find(id);
514  if (srch != m_interfaces.end())
515  m_interfaces.erase( srch );
516  }
517 
520  static InterfaceMap &getInterfaces() { return m_interfaces; }
521 
524  static Void init(ELogger &logger);
526  static Void uninit();
528  static Void reset();
529 
530 private:
531  static DiameterHook m_hook_error;
532  static DiameterHook m_hook_success;
533 
534  static ERWLock m_lock;
535  static EStatistics::InterfaceMap m_interfaces;
536 };
537 
538 #endif // #ifndef __ESTATS_H
EStatistics::Interface::addPeer
Peer & addPeer(const EString &peer)
Adds the specified peer.
Definition: estats.cpp:303
EStatistics::Interface::incResponseReceivedErrors
UInt incResponseReceivedErrors(const std::string &peer, UInt msgid)
Increments the response receive errors for the specified peer and message.
Definition: estats.h:439
EStatistics::Peer::Peer
Peer(cpStr name, const EStatistics::MessageStatsMap &tmplt)
Class constructor.
Definition: estats.cpp:220
EStatistics::Interface::incRequestReceivedErrors
UInt incRequestReceivedErrors(cpStr peer, UInt msgid)
Increments the request receive errors for the specified peer and message.
Definition: estats.h:366
EStatistics::Interface::incRequestSentOk
UInt incRequestSentOk(cpStr peer, UInt msgid)
Increments the request send successes for the specified peer and message.
Definition: estats.h:371
EStatistics::Interface::incRequestReceivedOk
UInt incRequestReceivedOk(cpStr peer, UInt msgid)
Increments the request receive successes for the specified peer and message.
Definition: estats.h:376
EStatistics::ProtocolType::gtpv2c
EStatistics::MessageStats::getResponseSentErrors
UInt getResponseSentErrors()
Retrieves the response send errors for this message.
Definition: estats.h:129
eerror.h
Defines base class for exceptions and declaration helper macros.
EStatistics::Peer::incResponseReceivedOkRejected
UInt incResponseReceivedOkRejected(UInt msgid)
Increments the response received success rejected for the specified message.
Definition: estats.h:285
EStatistics::Peer::incResponseReceivedOkAccepted
UInt incResponseReceivedOkAccepted(UInt msgid)
Increments the response received success aceepted for the specified message.
Definition: estats.h:281
EStatistics::Interface::incRequestReceivedOk
UInt incRequestReceivedOk(const std::string &peer, UInt msgid)
Increments the request receive successes for the specified peer and message.
Definition: estats.h:428
EStatistics::Peer::getName
EString & getName()
Retrieves the peer name.
Definition: estats.h:221
EStatistics::MessageStats::getResponseSentOkAccepted
UInt getResponseSentOkAccepted()
Retrieves the response send successes that were accepted for this message.
Definition: estats.h:135
ETime
Class for manipulating date and time of day values.
Definition: etime.h:199
EStatistics::MessageStats::incResponseSentOkAccepted
UInt incResponseSentOkAccepted()
Increments the response send successes that were accepted for this message.
Definition: estats.h:167
EStatistics::MessageStats::getRequestSentOk
UInt getRequestSentOk()
Retrieves the request send successes for this message.
Definition: estats.h:122
EStatistics::Peer::incResponseSentErrors
UInt incResponseSentErrors(UInt msgid)
Increments the response send errors for the specified message.
Definition: estats.h:265
ETime::Now
static ETime Now()
Retrieves the current time.
Definition: etime.cpp:1147
EStatistics::Peer::incRequestSentErrors
UInt incRequestSentErrors(UInt msgid)
Increments the request send errors for the specified message.
Definition: estats.h:248
EStatistics::MessageStats::incRequestSentErrors
UInt incRequestSentErrors()
Increments the request send errors for this message.
Definition: estats.h:148
True
#define True
True.
Definition: ebase.h:25
EStatistics::DiameterHook
Hooks into the freeDiameter internals to increment the message statistics.
Definition: estats.h:80
EStatistics::Interface::getPeers
PeerMap & getPeers()
Retrieves the collection of peers for this interface.
Definition: estats.h:329
EStatistics::MessageStats::incResponseSentOkRejected
UInt incResponseSentOkRejected()
Increments the response send successes that were rejected for this message.
Definition: estats.h:170
EStatistics::Interface::reset
Void reset()
Resets the message counters to zeroes for all peers.
Definition: estats.cpp:317
EStatistics::MessageStats::getRequestReceivedErrors
UInt getRequestReceivedErrors()
Retrieves the request receive errors for this message.
Definition: estats.h:119
ebase.h
Macros for various standard C library functions and standard includes.
EStatistics::MessageStats::getResponseSentOkRejected
UInt getResponseSentOkRejected()
Retrieves the response send successes that were rejected for this message.
Definition: estats.h:138
FDHook::process
virtual Void process(enum fd_hook_type type, struct msg *msg, struct peer_hdr *peer, Void *other, struct fd_hook_permsgdata *pmd)=0
Method that is called to process a freeDiameter hook callback.
EStatistics::Interface::incResponseSentErrors
UInt incResponseSentErrors(const std::string &peer, UInt msgid)
Increments the response send errors for the specified peer and message.
Definition: estats.h:434
EStatistics::Interface::getId
EStatistics::InterfaceId getId()
Retrieves the interface ID.
Definition: estats.h:320
EStatistics::ProtocolType
ProtocolType
Definition: estats.h:66
EStatistics::Interface::getMessageStatsTemplate
MessageStatsMap & getMessageStatsTemplate()
Retrieves the collection of message statistics.
Definition: estats.h:347
EStatistics::Peer::setLastActivity
ETime & setLastActivity()
Assigns the time stamp of the last activity.
Definition: estats.h:227
elogger.h
Defines the logging related classes.
EStatistics::MessageStats::incResponseReceivedOkAccepted
UInt incResponseReceivedOkAccepted()
Increments the response receive successes that were accepted for this message.
Definition: estats.h:173
esynch.h
Contains definitions for synchronization objects.
EStatistics::Interface::incResponseReceivedOkAccepted
UInt incResponseReceivedOkAccepted(cpStr peer, UInt msgid)
Increments the response receive success accepted for the specified peer and message.
Definition: estats.h:402
EStatistics::init
static Void init(ELogger &logger)
Initializes the statistics class.
Definition: estats.cpp:24
EStatistics::MessageStats::incRequestReceivedOk
UInt incRequestReceivedOk()
Increments the request received successes for this message.
Definition: estats.h:157
EStatistics::MessageStats::getResponseReceivedErrors
UInt getResponseReceivedErrors()
Retrieves the response receive errors for this message.
Definition: estats.h:132
EStatistics::Interface::getName
EString & getName()
Retrieves the interface name.
Definition: estats.h:323
EStatistics::InterfaceMap
std::unordered_map< EStatistics::InterfaceId, EStatistics::Interface > InterfaceMap
Definition: estats.h:477
ERWLock
Encapsulates a read-write lock object.
Definition: esynch.h:507
EStatistics::Interface::incRequestSentOk
UInt incRequestSentOk(const std::string &peer, UInt msgid)
Increments the request send successes for the specified peer and message.
Definition: estats.h:423
EStatistics::addInterface
static Interface & addInterface(EStatistics::InterfaceId id, ProtocolType protocol, const EString &intfc)
Adds/updates the interface.
Definition: estats.h:501
EStatistics::Interface::incRequestSentErrors
UInt incRequestSentErrors(const std::string &peer, UInt msgid)
Increments the request send errors for the specified peer and message.
Definition: estats.h:413
EStatistics::Interface::removePeer
Void removePeer(const EString &peer)
Removes the specified peer.
Definition: estats.cpp:309
etime.h
Provides class for manipulating time of day values.
EStatistics::MessageStats
Contains the statistics for an individual message.
Definition: estats.h:102
EStatistics::MessageStats::getId
EStatistics::MessageId getId()
Definition: estats.h:111
ELogger
Defines a logger.
Definition: elogger.h:78
EStatistics::Peer::reset
Void reset()
Sets all message statistics counters to zero.
Definition: estats.cpp:251
EStatistics::InterfaceId
UInt InterfaceId
Definition: estats.h:75
FDHook
Registers, unregisters and process freeDiameter hooks. See "MONITORING" in libfdcore....
Definition: efd.h:1792
EStatistics::Interface::incResponseSentOkRejected
UInt incResponseSentOkRejected(cpStr peer, UInt msgid)
Increments the response send success rejected for the specified peer and message.
Definition: estats.h:397
EStatistics::Peer::incRequestSentOk
UInt incRequestSentOk(UInt msgid)
Increments the request send successes for the specified message.
Definition: estats.h:256
EStatistics::MessageStats::getResponseReceivedOkRejected
UInt getResponseReceivedOkRejected()
Retrieves the response receive successes that were rejected for this message.
Definition: estats.h:144
EStatistics::MessageStats::incResponseReceivedOkRejected
UInt incResponseReceivedOkRejected()
Increments the response receive successes that were rejected for this message.
Definition: estats.h:176
EStatistics::MessageStats::incRequestSentOk
UInt incRequestSentOk()
Increments the request send successes for this message.
Definition: estats.h:154
EStatistics::getInterfaces
static InterfaceMap & getInterfaces()
Retrieves the interface collection.
Definition: estats.h:520
EStatistics::ProtocolType::ikev2
ERDLock
Request a read lock for the specified read-write lock object.
Definition: esynch.h:535
EStatistics::removeInterface
static Void removeInterface(EStatistics::InterfaceId id)
Removes the specified interface.
Definition: estats.h:510
EStatistics::MessageStats::reset
Void reset()
Definition: estats.cpp:202
EStatistics::Interface::incResponseSentOkAccepted
UInt incResponseSentOkAccepted(const std::string &peer, UInt msgid)
Increments the response send success accepted for the specified peer and message.
Definition: estats.h:444
EStatistics::Interface::incResponseReceivedOkAccepted
UInt incResponseReceivedOkAccepted(const std::string &peer, UInt msgid)
Increments the response receive success accepted for the specified peer and message.
Definition: estats.h:454
EStatistics::MessageStats::incRequestReceivedErrors
UInt incRequestReceivedErrors()
Increments the request receive errors for this message.
Definition: estats.h:151
EStatistics::Interface::incResponseReceivedOkRejected
UInt incResponseReceivedOkRejected(const std::string &peer, UInt msgid)
Increments the response receive rejected accepted for the specified peer and message.
Definition: estats.h:459
EStatistics::MessageStatsMap
std::unordered_map< EStatistics::MessageId, EStatistics::MessageStats > MessageStatsMap
Definition: estats.h:197
EStatistics::PeerMap
std::unordered_map< std::string, EStatistics::Peer > PeerMap
Defines a collection of peers.
Definition: estats.h:298
EStatistics::Interface::addMessageStatsTemplate
MessageStats & addMessageStatsTemplate(EStatistics::MessageId msgid, const EString &name)
Adds a message to the statistics message template for this interface.
Definition: estats.cpp:324
EStatistics::reset
static Void reset()
Sets the message counters to zero for all interfaces, peers and messages.
Definition: estats.cpp:42
EStatistics::Interface::incResponseSentOkRejected
UInt incResponseSentOkRejected(const std::string &peer, Int msgid)
Increments the response send success rejected for the specified peer and message.
Definition: estats.h:449
EStatistics::MessageStats::getRequestReceivedOk
UInt getRequestReceivedOk()
Retrieves the request received successes for this message.
Definition: estats.h:125
EStatistics::Interface::getProtocol
ProtocolType getProtocol()
Retrieves the interface protocol.
Definition: estats.h:326
EStatistics::Interface::incResponseSentErrors
UInt incResponseSentErrors(cpStr peer, UInt msgid)
Increments the response send errors for the specified peer and message.
Definition: estats.h:382
EWRLock
Request a write lock for the specified read-write lock object.
Definition: esynch.h:574
EStatistics::Interface
Represents an interface to track peer and message statistics for.
Definition: estats.h:301
EStatistics::uninit
static Void uninit()
Uninitializes teh statistics class.
Definition: estats.cpp:36
EStatistics::Peer::getLastActivity
ETime & getLastActivity()
Retrieves the time stamp of the last activity.
Definition: estats.h:224
EStatistics::Interface::incResponseReceivedOkRejected
UInt incResponseReceivedOkRejected(cpStr peer, UInt msgid)
Increments the response receive rejected accepted for the specified peer and message.
Definition: estats.h:407
EStatistics::ProtocolType::gtpv1u
EStatistics::MessageStats::incResponseReceivedErrors
UInt incResponseReceivedErrors()
Increments the response receive errors for this message.
Definition: estats.h:164
EString::format
EString & format(cpChar pszFormat,...)
Sets the value to the string using a "printf" style format string and arguments.
Definition: estring.cpp:38
EStatistics::Interface::incResponseReceivedErrors
UInt incResponseReceivedErrors(cpStr peer, UInt msgid)
Increments the response receive errors for the specified peer and message.
Definition: estats.h:387
EStatistics::Peer::incRequestReceivedErrors
UInt incRequestReceivedErrors(UInt msgid)
Increments the request receive errors for the specified message.
Definition: estats.h:252
EStatistics::Peer::incResponseReceivedErrors
UInt incResponseReceivedErrors(UInt msgid)
Increments the response receive errors for the specified message.
Definition: estats.h:269
EString
String class.
Definition: estring.h:30
EStatistics::MessageStats::incResponseSentErrors
UInt incResponseSentErrors()
Increments the response send errors for this message.
Definition: estats.h:161
EStatistics::getInterface
static Interface & getInterface(EStatistics::InterfaceId id)
Retrieves the requested interface object.
Definition: estats.h:483
EStatistics::ProtocolType::diameter
EStatistics::Interface::incRequestReceivedErrors
UInt incRequestReceivedErrors(const std::string &peer, UInt msgid)
Increments the request receive errors for the specified peer and message.
Definition: estats.h:418
EStatistics
Definition: estats.h:63
EStatistics::MessageStats::getResponseReceivedOkAccepted
UInt getResponseReceivedOkAccepted()
Retrieves the response receive successes that were accepted for this message.
Definition: estats.h:141
EError
The base class for exceptions derived from std::exception.
Definition: eerror.h:92
EError::Warning
Warning.
Definition: eerror.h:101
EStatistics::ProtocolType::pfcp
EStatistics::Peer::incResponseSentOkRejected
UInt incResponseSentOkRejected(UInt msgid)
Increments the response send success rejected for the specified message.
Definition: estats.h:277
EStatistics::MessageStats::getName
const EString & getName()
Definition: estats.h:112
EStatistics::Peer::getMessageStats
EStatistics::MessageStatsMap & getMessageStats()
Retrieves the message statistics collection for this peer.
Definition: estats.h:230
estring.h
Encapsulates and extends a std::string object.
EStatistics::Peer::incRequestReceivedOk
UInt incRequestReceivedOk(UInt msgid)
Increments the request receive successes for the specified message.
Definition: estats.h:260
EStatistics::Interface::incRequestSentErrors
UInt incRequestSentErrors(cpStr peer, UInt msgid)
Increments the request send errors for the specified peer and message.
Definition: estats.h:361
efd.h
freeDiameter wrapper classes.
EStatistics::Peer::incResponseSentOkAccepted
UInt incResponseSentOkAccepted(UInt msgid)
Increments the response send success aceepted for the specified message.
Definition: estats.h:273
EStatistics::MessageStats::getRequestSentErrors
UInt getRequestSentErrors()
Retrieves the request send errors for this message.
Definition: estats.h:116
EStatistics::Peer
Contains the peer information including the statistics for the individual messages.
Definition: estats.h:200
EStatistics::Interface::incResponseSentOkAccepted
UInt incResponseSentOkAccepted(cpStr peer, UInt msgid)
Increments the response send success accepted for the specified peer and message.
Definition: estats.h:392
EStatistics::Interface::getPeer
Peer & getPeer(const EString &peer, Bool addFlag=True)
Retrieves the specified peer with option to add if it does not exist.
Definition: estats.cpp:283
EStatistics::MessageId
UInt MessageId
Definition: estats.h:76