3 #ifndef _MADARA_BANDWIDTH_MONITOR_H 4 #define _MADARA_BANDWIDTH_MONITOR_H 17 #include "madara/LockType.h" 19 #include "madara/MadaraExport.h" 63 void add (uint64_t size);
70 void add (time_t timestamp, uint64_t size);
77 bool is_bandwidth_violated (int64_t limit);
83 void set_window (time_t window_in_secs);
90 uint64_t get_utilization (
void);
97 uint64_t get_bytes_per_second (
void);
107 void print_utilization (
void);
113 size_t get_number_of_messages (
void);
120 time_t update_utilization (
void);
147 #endif // _MADARA_BANDWIDTH_MONITOR_H MADARA_LOCK_TYPE mutex_
Mutex for supporting multithreaded monitor calls.
BandwidthMessages messages_
Map of timestamps to messages.
std::pair< time_t, uint64_t > BandwidthRecord
uint64_t utilization_
Utilization.
std::deque< BandwidthRecord > BandwidthMessages
Provides monitoring capability of a transport's bandwidth.
Copyright (c) 2015 Carnegie Mellon University.
time_t window_
Time window for useful messages to bandwidth calculations.