r-type  0.0.0
R-Type main
Loading...
Searching...
No Matches
utl::EventStats Class Reference

Event statistics structure. More...

#include <Event.hpp>

+ Collaboration diagram for utl::EventStats:

Public Member Functions

void reset ()
 Reset all statistics.
 
double getEventsPerSecond () const
 Get events per second rate.
 

Public Attributes

std::uint64_t totalEventsPublished = 0
 Total events published.
 
std::uint64_t totalEventsConsumed = 0
 Total events consumed.
 
std::uint64_t totalEventsExpired = 0
 Total events that expired.
 
std::uint64_t currentQueueSize = 0
 Current queue size.
 
std::uint64_t maxQueueSize = 0
 Maximum queue size reached.
 
std::chrono::steady_clock::time_point startTime
 Statistics start time.
 
std::unordered_map< EventType, std::uint64_t > eventTypeCount
 Count per event type.
 
std::unordered_map< EventPriority, std::uint64_t > priorityCount
 Count per priority.
 
std::unordered_map< std::uint32_t, std::uint64_t > sourceCount
 Count per source component.
 
std::unordered_map< std::uint32_t, std::uint64_t > targetCount
 Count per target component.
 

Detailed Description

Event statistics structure.

Definition at line 165 of file Event.hpp.

Member Function Documentation

◆ getEventsPerSecond()

double utl::EventStats::getEventsPerSecond ( ) const
inline

Get events per second rate.

Returns
Events per second

Definition at line 200 of file Event.hpp.

References startTime, and totalEventsPublished.

◆ reset()

void utl::EventStats::reset ( )
inline

Reset all statistics.

Definition at line 182 of file Event.hpp.

References currentQueueSize, eventTypeCount, maxQueueSize, priorityCount, sourceCount, startTime, targetCount, totalEventsConsumed, totalEventsExpired, and totalEventsPublished.

Referenced by utl::EventBus::clearStats(), and utl::EventBus::EventBus().

+ Here is the caller graph for this function:

Member Data Documentation

◆ currentQueueSize

std::uint64_t utl::EventStats::currentQueueSize = 0

Current queue size.

Definition at line 171 of file Event.hpp.

Referenced by utl::EventBus::getStats(), and reset().

◆ eventTypeCount

std::unordered_map<EventType, std::uint64_t> utl::EventStats::eventTypeCount

Count per event type.

Definition at line 174 of file Event.hpp.

Referenced by reset(), and utl::EventBus::updateStats().

◆ maxQueueSize

std::uint64_t utl::EventStats::maxQueueSize = 0

Maximum queue size reached.

Definition at line 172 of file Event.hpp.

Referenced by reset().

◆ priorityCount

std::unordered_map<EventPriority, std::uint64_t> utl::EventStats::priorityCount

Count per priority.

Definition at line 175 of file Event.hpp.

Referenced by reset(), and utl::EventBus::updateStats().

◆ sourceCount

std::unordered_map<std::uint32_t, std::uint64_t> utl::EventStats::sourceCount

Count per source component.

Definition at line 176 of file Event.hpp.

Referenced by reset(), and utl::EventBus::updateStats().

◆ startTime

std::chrono::steady_clock::time_point utl::EventStats::startTime

Statistics start time.

Definition at line 173 of file Event.hpp.

Referenced by getEventsPerSecond(), and reset().

◆ targetCount

std::unordered_map<std::uint32_t, std::uint64_t> utl::EventStats::targetCount

Count per target component.

Definition at line 177 of file Event.hpp.

Referenced by reset(), and utl::EventBus::updateStats().

◆ totalEventsConsumed

std::uint64_t utl::EventStats::totalEventsConsumed = 0

Total events consumed.

Definition at line 169 of file Event.hpp.

Referenced by reset(), and utl::EventBus::updateStats().

◆ totalEventsExpired

std::uint64_t utl::EventStats::totalEventsExpired = 0

Total events that expired.

Definition at line 170 of file Event.hpp.

Referenced by reset(), and utl::EventBus::updateStats().

◆ totalEventsPublished

std::uint64_t utl::EventStats::totalEventsPublished = 0

Total events published.

Definition at line 168 of file Event.hpp.

Referenced by getEventsPerSecond(), reset(), and utl::EventBus::updateStats().


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