artdaq_mfextensions  v1_03_03a
throttle Class Reference

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

#include <mfextensions/Extensions/throttle.hh>

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 More...
 
bool reach_limit (std::string const &name, timeval tm)
 Determine whether the name has reached the throttling limit More...
 
void use (bool flag)
 Enable or disable this throttle More...
 

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
nameRegular expression to match messages
limitNumber of messages before throttling is enabled
timespanTime 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
nameName to check against regular expression
tmTime of message
Returns
Whether the message should be throttled

Definition at line 13 of file throttle.cc.

void throttle::use ( bool  flag)
inline

Enable or disable this throttle

Parameters
flagWhether the throttle should be enabled

Definition at line 39 of file throttle.hh.


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