senf::ppi::module::RateAnalyzer Class Reference

Generate periodic packet statistics. More...

#include <senf/PPI/RateAnalyzer.hh>

Inheritance diagram for senf::ppi::module::RateAnalyzer:

Classes

struct  Statistics
 

Public Member Functions

void startStatistics (senf::ClockService::clock_type interval)
 Start generating statistics at given interval. More...
 
- Public Member Functions inherited from senf::ppi::module::Module
virtual ~Module ()
 

Public Attributes

struct senf::ppi::module::RateAnalyzer::Statistics signals
 
- Public Attributes inherited from senf::ppi::module::MonitorModule<>
senf::ppi::connector::PassiveInput< Packetinput
 
senf::ppi::connector::ActiveOutput< Packetoutput
 

Structors and default members

 RateAnalyzer ()
 

Additional Inherited Members

- Protected Member Functions inherited from senf::ppi::module::MonitorModule<>
 MonitorModule ()
 
- Protected Member Functions inherited from senf::ppi::module::Module
 Module ()
 
Route< connector::InputConnector, connector::OutputConnector > & route (connector::InputConnector &input, connector::OutputConnector &output)
 Define flow information. More...
 
Route< connector::InputConnector, EventDescriptor > & route (connector::InputConnector &input, EventDescriptor &output)
 Define flow information. More...
 
Route< EventDescriptor, connector::OutputConnector > & route (EventDescriptor &input, connector::OutputConnector &output)
 Define flow information. More...
 
void noroute (connector::Connector &connector)
 Define terminal connectors. More...
 
template<class Target >
void registerEvent (EventDescriptor &descriptor, Target target)
 Register an external event. More...
 
ClockService::clock_type const & time () const
 Time-stamp of the currently processing event. More...
 
ClockService::clock_type const & now () const
 Current time of the currently processing event. More...
 
virtual void v_init ()
 Called after module setup. More...
 
console::DirectoryNodesysConsoleDir () const
 
void destroy ()
 

Detailed Description

Generate periodic packet statistics.

This module will periodically generate statistics concerning the traversing packets. The statistics are emitted as Boost.Signals signals:

  • signals.packetsPerSecond: number of packets in the last interval scaled to 1 second
  • signals.bytesPerSecond; number of bytes in the last interval scaled to 1 second
  • signals.bytesPerPacket: minimal, average and maximal packet size in the last interval

These signals are normally connected as needed to senf::Statistics instances.

senf::RateAnalyzer analyzer;
senf::Statistics packetSize;
analyzer.signals.packetsPerSecond.connect(packets);
analyzer.signals.bytesPerPacket.connect(packetSize);
analyzer.startStatistics(senf::ClockService::milliseconds(100u));
    Statistics output is only generated after a call to startStatistics()

Definition at line 59 of file RateAnalyzer.hh.

Constructor & Destructor Documentation

◆ RateAnalyzer()

senf::ppi::module::RateAnalyzer::RateAnalyzer ( )

Definition at line 26 of file RateAnalyzer.cc.

Member Function Documentation

◆ startStatistics()

void senf::ppi::module::RateAnalyzer::startStatistics ( senf::ClockService::clock_type  interval)

Start generating statistics at given interval.

Definition at line 32 of file RateAnalyzer.cc.

Member Data Documentation

◆ signals

struct senf::ppi::module::RateAnalyzer::Statistics senf::ppi::module::RateAnalyzer::signals

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