throttle Class Reference

Throttle messages based on name and time limits. Separate from MessageFacility limiting. More...

#include <mfextensions/Extensions/throttle.hh>

List of all members.

Public Member Functions

 throttle (std::string const &name, int limit, long timespan)
 Throttle messages using a regular expression if they occurr above a certain frequency.
bool reach_limit (std::string const &name, timeval tm)
 Determine whether the name has reached the throttling limit.
void use (bool flag)
 Enable or disable this throttle.

Detailed Description

Throttle messages based on name and time limits. Separate from MessageFacility limiting.

Definition at line 17 of file throttle.hh.


Constructor & Destructor Documentation

throttle::throttle ( std::string const &  name,
int  limit,
long  timespan 
)

Throttle messages using a regular expression if they occurr above a certain frequency.

Parameters:
name Regular expression to match messages
limit Number of messages before throttling is enabled
timespan Time limit for throttling

Definition at line 3 of file throttle.cc.


Member Function Documentation

bool throttle::reach_limit ( std::string const &  name,
timeval  tm 
)

Determine whether the name has reached the throttling limit.

Parameters:
name Name to check against regular expression
tm Time of message
Returns:
Whether the message should be throttled

Definition at line 14 of file throttle.cc.

void throttle::use ( bool  flag  )  [inline]

Enable or disable this throttle.

Parameters:
flag Whether the throttle should be enabled

Definition at line 40 of file throttle.hh.


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

Generated on 23 Oct 2018 for artdaq_mfextensions by  doxygen 1.6.1