3 #ifndef _MADARA_BANDWIDTH_MONITOR_H 4 #define _MADARA_BANDWIDTH_MONITOR_H 17 #include "madara/LockType.h" 19 #include "ace/Guard_T.h" 20 #include "ace/Recursive_Thread_Mutex.h" 21 #include "madara/MADARA_export.h" 65 void add (uint64_t size);
72 void add (time_t timestamp, uint64_t size);
79 bool is_bandwidth_violated (int64_t limit);
85 void set_window (time_t window_in_secs);
92 uint64_t get_utilization (
void);
99 uint64_t get_bytes_per_second (
void);
109 void print_utilization (
void);
115 size_t get_number_of_messages (
void);
122 time_t update_utilization (
void);
149 #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.