2 #ifndef _BANDWIDTH_MONITOR_INL_
3 #define _BANDWIDTH_MONITOR_INL_
10 MADARA_GUARD_TYPE guard(
mutex_);
12 time_t cur_time = time(NULL);
13 time_t earliest_time = cur_time -
window_;
15 BandwidthMessages::iterator begin =
messages_.begin();
16 BandwidthMessages::iterator end = begin;
18 for (end = begin; end !=
messages_.end(); ++end)
24 if (end->first < earliest_time)
uint64_t utilization_
Utilization.
time_t window_
Time window for useful messages to bandwidth calculations.
MADARA_LOCK_TYPE mutex_
Mutex for supporting multithreaded monitor calls.
time_t update_utilization(void)
Updates utilization for most public functions.
BandwidthMessages messages_
Map of timestamps to messages.