1 #ifndef artdaq_mfextensions_extensions_throttle_hh
2 #define artdaq_mfextensions_extensions_throttle_hh
8 #include <boost/regex.hpp>
10 typedef boost::regex regex_t;
11 typedef boost::smatch smatch_t;
25 throttle(std::string
const& name,
int limit,
long timespan);
33 bool reach_limit(std::string
const& name, timeval tm);
39 void use(
bool flag) { in_use_ = flag; }
47 long last_window_start_;
52 #endif // artdaq_mfextensions_extensions_throttle_hh
void use(bool flag)
Enable or disable this throttle
throttle(std::string const &name, int limit, long timespan)
Throttle messages using a regular expression if they occurr above a certain frequency ...
Throttle messages based on name and time limits. Separate from MessageFacility limiting.
bool reach_limit(std::string const &name, timeval tm)
Determine whether the name has reached the throttling limit