EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | List of all members
PFCP::RemoteNode::Stats Class Reference

A class to hold message statistics for the remote node. More...

#include <epfcp.h>

Public Member Functions

ERWLockgetLock ()
 Returns the read/write lock protecting the message stats map and access to last activity. More...
 
MessageStatsMap & messageStats ()
 Returns the message stats map for this remote node. Access to this reference must be protected with the lock returned by getLock() for thread-safety. More...
 
ETime getLastActivity ()
 Retrieves the time stamp of the last activity. This method is thread-safe. More...
 
Void setLastActivity ()
 Assigns the time stamp of the last activity. This method is thread-safe. More...
 
Void reset ()
 Sets all message statistics counters to zero. This method is thread-safe. More...
 
UInt incReceived (MessageId msgid)
 Increments the received count for the given message identifier. If the message identifier cannot be found in the map (see Configuration::MessageStatsTemplate()) then this is a no-op. This function also updates the last activity. This method is thread-safe. More...
 
UInt incSent (MessageId msgid, UInt attempt=0)
 Increments the sent count for the given message identifier. If the message identifier cannot be found in the map (see Configuration::MessageStatsTemplate()) then this is a no-op. This function also updates the last activity. This method is thread-safe. More...
 
UInt incTimeout (MessageId msgid)
 Increments the received count for the given message identifier. If the message identifier cannot be found in the map (see Configuration::MessageStatsTemplate()) then this is a no-op. This function also updates the last activity. This method is thread-safe. More...
 

Detailed Description

A class to hold message statistics for the remote node.

Member Function Documentation

ETime PFCP::RemoteNode::Stats::getLastActivity ( )

Retrieves the time stamp of the last activity. This method is thread-safe.

Returns
the time stamp of the last activity.
ERWLock& PFCP::RemoteNode::Stats::getLock ( )
inline

Returns the read/write lock protecting the message stats map and access to last activity.

Returns
a reference to the read/write lock
UInt PFCP::RemoteNode::Stats::incReceived ( MessageId  msgid)

Increments the received count for the given message identifier. If the message identifier cannot be found in the map (see Configuration::MessageStatsTemplate()) then this is a no-op. This function also updates the last activity. This method is thread-safe.

Parameters
msgidthe message identifier
Returns
the incremented received count or zero if the message wasn't found
UInt PFCP::RemoteNode::Stats::incSent ( MessageId  msgid,
UInt  attempt = 0 
)

Increments the sent count for the given message identifier. If the message identifier cannot be found in the map (see Configuration::MessageStatsTemplate()) then this is a no-op. This function also updates the last activity. This method is thread-safe.

Parameters
msgidthe message identifier
attemptthe sent attempt index to increment. attempt values greater than MAX_ATTEMPTS are grouped at the MAX_ATTEMPTS index.
Returns
the incremented sent count or zero if the message wasn't found
UInt PFCP::RemoteNode::Stats::incTimeout ( MessageId  msgid)

Increments the received count for the given message identifier. If the message identifier cannot be found in the map (see Configuration::MessageStatsTemplate()) then this is a no-op. This function also updates the last activity. This method is thread-safe.

Parameters
msgidthe message identifier
Returns
the incremented received count or zero if the message wasn't found
MessageStatsMap& PFCP::RemoteNode::Stats::messageStats ( )
inline

Returns the message stats map for this remote node. Access to this reference must be protected with the lock returned by getLock() for thread-safety.

Returns
a reference to the message stats map
Void PFCP::RemoteNode::Stats::reset ( )

Sets all message statistics counters to zero. This method is thread-safe.

Void PFCP::RemoteNode::Stats::setLastActivity ( )

Assigns the time stamp of the last activity. This method is thread-safe.


The documentation for this class was generated from the following files: