DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ers::ThrottleStream Class Reference

Throws issues as exceptions. More...

#include <ThrottleStream.hpp>

Inheritance diagram for ers::ThrottleStream:
[legend]
Collaboration diagram for ers::ThrottleStream:
[legend]

Classes

class  IssueRecord
 

Public Member Functions

 ThrottleStream (const std::string &criteria)
 
void write (const ers::Issue &issue) override
 
- Public Member Functions inherited from ers::OutputStream
virtual ~OutputStream ()
 Sends the issue into this stream.
 

Private Types

typedef std::map< std::string, IssueRecordIssueMap
 

Private Member Functions

void throttle (IssueRecord &record, const ers::Issue &issue)
 
void reportSuppression (IssueRecord &record, const ers::Issue &issue)
 

Private Attributes

IssueMap m_issueMap
 
int m_initialThreshold
 
int m_timeLimit
 
std::mutex m_mutex
 

Additional Inherited Members

- Protected Member Functions inherited from ers::OutputStream
 OutputStream ()
 
OutputStreamchained ()
 
virtual bool isNull () const
 

Detailed Description

Throws issues as exceptions.

This class implements a stream that swallows identical issues if they are sent to the given stream too often. In order to employ this implementation in a stream configuration the name to be used is "throttle". E.g. the following configuration will suppress identical issues from been printed to the standard output:

    export DUNEDAQ_ERS_FATAL="throttle(10, 20),stdout"

This stream has two configuration parameters:

  • first parameter defines an initial number of identical messages after which the throttling shall be started
  • second parameter defines a timeout in seconds after which the throttling is reset to its initial state if no issues of a given type have been reported in this period
Author
Serguei Kolos

Definition at line 34 of file ThrottleStream.hpp.

Member Typedef Documentation

◆ IssueMap

std::map<std::string, IssueRecord> ers::ThrottleStream::IssueMap
private

Definition at line 59 of file ThrottleStream.hpp.

Constructor & Destructor Documentation

◆ ThrottleStream()

ers::ThrottleStream::ThrottleStream ( const std::string & criteria)
explicit

Member Function Documentation

◆ reportSuppression()

void ers::ThrottleStream::reportSuppression ( IssueRecord & record,
const ers::Issue & issue )
private

◆ throttle()

void ers::ThrottleStream::throttle ( IssueRecord & record,
const ers::Issue & issue )
private

◆ write()

void ers::ThrottleStream::write ( const ers::Issue & issue)
overridevirtual

Implements ers::OutputStream.

Member Data Documentation

◆ m_initialThreshold

int ers::ThrottleStream::m_initialThreshold
private

Definition at line 62 of file ThrottleStream.hpp.

◆ m_issueMap

IssueMap ers::ThrottleStream::m_issueMap
private

Definition at line 60 of file ThrottleStream.hpp.

◆ m_mutex

std::mutex ers::ThrottleStream::m_mutex
private

Definition at line 64 of file ThrottleStream.hpp.

◆ m_timeLimit

int ers::ThrottleStream::m_timeLimit
private

Definition at line 63 of file ThrottleStream.hpp.


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