senf::StatisticsBase Class Reference

Internal: Generic Statistics collection. More...

#include <senf/Utils/Statistics.hh>

Inheritance diagram for senf::StatisticsBase:
Inheritance graph
[legend]

List of all members.


Detailed Description

Internal: Generic Statistics collection.

Definition at line 68 of file Statistics.hh.


Classes

struct   DuplicateRankException
struct   InvalidRankException
struct   OutputEntry
class   OutputProxy
  Output connection interface. More...
struct   QueueEntry
struct   Transform

Public Types

typedef boost::iterator_range
< ValueIterator > 
CollectorRange

Public Member Functions

void  consoleList (unsigned level, std::ostream &os) const

Accessing the current value

float  min () const
  Last min value entered.
float  avg () const
  Last avg value entered.
float  max () const
  Last max value entered.
float  dev () const
  Last dev value entered.
virtual unsigned  rank () const
  Return collectors rank value.

Child collectors

Collector operator[] (unsigned rank)
  Get child collector.
Collector const &  operator[] (unsigned rank) const
  Get child collector.
CollectorRange  collectors ()
  List all child collectors.
Collector collect (unsigned rank)
  Register a new collector.
Statistics base ()
  Get base statistics object.
std::string  path () const
  Get the path to this collector.

Result generation

OutputProxy< StatisticsBase output (unsigned n=1u)
  Register output.

Protected Member Functions

  StatisticsBase ()
virtual  ~StatisticsBase ()
void  enter (unsigned n, float min, float avg, float max, float dev)

Member Typedef Documentation

typedef boost::iterator_range<ValueIterator> senf::StatisticsBase::
CollectorRange

Definition at line 80 of file Statistics.hh.


Constructor & Destructor Documentation

senf::StatisticsBase::
StatisticsBase ()

Definition at line 87 of file Statistics.cci.

senf::StatisticsBase::
~StatisticsBase ()

Definition at line 91 of file Statistics.cci.


Member Function Documentation

float senf::StatisticsBase::
avg ()

Last avg value entered.

Definition at line 105 of file Statistics.cci.

senf::Statistics & senf::StatisticsBase::
base ()

Get base statistics object.

Returns the base statistics object. If this is a child collector, this will return the outermost statistics object, otherwise it will return *this.

Definition at line 129 of file Statistics.cci.

senf::Collector & senf::StatisticsBase::
collect ( unsigned  rank )

Register a new collector.

Adds a collector collecting rank values into each combined value.

Parameters:
[in]  rank  number of values to collect
Returns:
Reference to new collector
Exceptions:
DuplicateRankException  if a collector collecting rank values already exists.

Definition at line 75 of file Statistics.cc.

senf::StatisticsBase::CollectorRange senf::StatisticsBase::
collectors ()

List all child collectors.

Returns:
iterator range of child collector references

Definition at line 94 of file Statistics.cci.

void senf::StatisticsBase::
consoleList ( unsigned  level,
std::ostream &  os )

Definition at line 100 of file Statistics.cc.

float senf::StatisticsBase::
dev ()

Last dev value entered.

Definition at line 117 of file Statistics.cci.

void senf::StatisticsBase::
enter ( unsigned  n,
float  min,
float  avg,
float  max,
float  dev )

Definition at line 44 of file Statistics.cc.

float senf::StatisticsBase::
max ()

Last max value entered.

Definition at line 111 of file Statistics.cci.

float senf::StatisticsBase::
min ()

Last min value entered.

Definition at line 99 of file Statistics.cci.

senf::Collector const & senf::StatisticsBase::
operator[] ( unsigned  rank )

Get child collector.

This member will return a const reference to the collector collecting rank values.

Parameters:
[in]  rank  Number of values the requested collector collects into each combined value.
Exceptions:
InvalidRankException  if rank is not a valid registered rank value.

Definition at line 66 of file Statistics.cc.

senf::Collector & senf::StatisticsBase::
operator[] ( unsigned  rank )

Get child collector.

This member will return a reference to the collector collecting rank values.

Parameters:
[in]  rank  Number of values the requested collector collects into each combined value.
Exceptions:
InvalidRankException  if rank is not a valid registered rank value.

Definition at line 58 of file Statistics.cc.

senf::StatisticsBase::OutputProxy< senf::StatisticsBase > senf::StatisticsBase::
output ( unsigned  n = 1u )

Register output.

This call will request the collector to output statistics build by averaging the last n values. This output is generated for every new value in the collector. The output signal can be connected to an arbitrary target using the returned proxy. Example:

stats.output(4u).connect(
    senf::StatisticsLogger());
Parameters:
[in]  n  size of sliding average window

Reimplemented in senf::Statistics, and senf::Collector.

Definition at line 85 of file Statistics.cc.

std::string senf::StatisticsBase::
path ()

Get the path to this collector.

Returns the '-'-separated list of collectors up to here. If this is the basic statistics object, the value is empty, otherwise it is built by joining the collector ranks.

Definition at line 134 of file Statistics.cci.

unsigned senf::StatisticsBase::
rank ()

Return collectors rank value.

Returns:
number of basic values collected into each new value by this collector.

Reimplemented in senf::Collector.

Definition at line 123 of file Statistics.cci.


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