1 #include "mfextensions/Extensions/throttle.hh"
9 , last_window_start_(0)
15 if (!in_use_)
return false;
17 if (!boost::regex_match(name, what_, expr_))
20 if (limit_ == 0)
return true;
21 else if (limit_ < 0)
return false;
27 return count_ > limit_ ?
true :
false;
31 if (sec - last_window_start_ > timespan_)
33 last_window_start_ = sec;
41 return count_ > limit_ ?
true :
false;
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