1 #include "mfextensions/Extensions/throttle.hh"
9 , last_window_start_(0)
16 if (!in_use_)
return false;
18 if (!boost::regex_match(name, what_, expr_))
21 if (limit_ == 0)
return true;
22 else if (limit_ < 0)
return false;
28 return count_ > limit_ ?
true :
false;
32 if (sec - last_window_start_ > timespan_)
34 last_window_start_ = sec;
42 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