MADARA
3.1.8
|
Provides scheduler for dropping packets. More...
#include <PacketScheduler.h>
Public Member Functions | |
PacketScheduler (const QoSTransportSettings *settings=0) | |
Default constructor. More... | |
PacketScheduler (const PacketScheduler &rhs) | |
Copy constructor. More... | |
virtual | ~PacketScheduler () |
Destructor. More... | |
bool | add (void) |
Adds a message to the monitor. More... | |
void | attach (const QoSTransportSettings *settings) |
Attaches settings. More... | |
void | clear (void) |
Clears the packet scheduler. More... | |
uint64_t | get_dropped (void) |
Queries the monitor for the current dropped messages. More... | |
uint64_t | get_sent (void) |
Queries the monitor for the current sent messages per second over the past window. More... | |
void | operator= (const PacketScheduler &rhs) |
Assignment operator. More... | |
void | print_status (unsigned int log_level=0, const char *prefix="PacketScheduler") |
Prints the number of status of the packet scheduler. More... | |
void | reset (void) |
Resets the packet scheduler to current settings. More... | |
Protected Attributes | |
uint64_t | consecutive_drops_ |
Consecutive dropped messages. More... | |
uint64_t | dropped_messages_ |
Number of dropped messages. More... | |
MADARA_LOCK_TYPE | mutex_ |
Mutex for supporting multithreaded monitor calls. More... | |
std::priority_queue< StrideTask, std::vector< StrideTask > > | queue_ |
queue used by stride scheduling algorithm More... | |
uint64_t | sent_messages_ |
Number of sent messages. More... | |
const QoSTransportSettings * | settings_ |
Transport settings. More... | |
Provides scheduler for dropping packets.
Definition at line 36 of file PacketScheduler.h.
madara::transport::PacketScheduler::PacketScheduler | ( | const QoSTransportSettings * | settings = 0 | ) |
Default constructor.
Definition at line 90 of file PacketScheduler.cpp.
madara::transport::PacketScheduler::PacketScheduler | ( | const PacketScheduler & | rhs | ) |
Copy constructor.
rhs | the value to be copied into this class |
Definition at line 99 of file PacketScheduler.cpp.
|
virtual |
Destructor.
Definition at line 108 of file PacketScheduler.cpp.
bool madara::transport::PacketScheduler::add | ( | void | ) |
Adds a message to the monitor.
call the accessor functions only once
if the drop rate is greater than 100% or drop burst is greater than 1 and we do not have that many consecutive drops
Definition at line 127 of file PacketScheduler.cpp.
void madara::transport::PacketScheduler::attach | ( | const QoSTransportSettings * | settings | ) |
Attaches settings.
settings | Settings to attach to this scheduler |
Definition at line 215 of file PacketScheduler.cpp.
void madara::transport::PacketScheduler::clear | ( | void | ) |
Clears the packet scheduler.
Definition at line 222 of file PacketScheduler.cpp.
uint64_t madara::transport::PacketScheduler::get_dropped | ( | void | ) |
Queries the monitor for the current dropped messages.
Definition at line 276 of file PacketScheduler.cpp.
uint64_t madara::transport::PacketScheduler::get_sent | ( | void | ) |
Queries the monitor for the current sent messages per second over the past window.
Definition at line 283 of file PacketScheduler.cpp.
void madara::transport::PacketScheduler::operator= | ( | const PacketScheduler & | rhs | ) |
Assignment operator.
rhs | the value to be copied into this class |
Definition at line 113 of file PacketScheduler.cpp.
void madara::transport::PacketScheduler::print_status | ( | unsigned int | log_level = 0 , |
const char * | prefix = "PacketScheduler" |
||
) |
Prints the number of status of the packet scheduler.
log_level | the log level to print status at |
prefix | the prefix of the calling function to allow for more descriptive and relevant status |
Definition at line 264 of file PacketScheduler.cpp.
void madara::transport::PacketScheduler::reset | ( | void | ) |
Resets the packet scheduler to current settings.
Definition at line 234 of file PacketScheduler.cpp.
|
protected |
Consecutive dropped messages.
Definition at line 132 of file PacketScheduler.h.
|
protected |
Number of dropped messages.
Definition at line 127 of file PacketScheduler.h.
|
mutableprotected |
Mutex for supporting multithreaded monitor calls.
Definition at line 112 of file PacketScheduler.h.
|
protected |
queue used by stride scheduling algorithm
Definition at line 137 of file PacketScheduler.h.
|
protected |
Number of sent messages.
Definition at line 122 of file PacketScheduler.h.
|
protected |
Transport settings.
Definition at line 117 of file PacketScheduler.h.