rippled
|
Manages load sources. More...
Public Member Functions | |
LoadManager ()=delete | |
LoadManager (LoadManager const &)=delete | |
LoadManager & | operator= (LoadManager const &)=delete |
~LoadManager () | |
Destroy the manager. More... | |
void | activateDeadlockDetector () |
Turn on deadlock detection. More... | |
void | resetDeadlockDetector () |
Reset the deadlock detection timer. More... | |
void | start () |
void | stop () |
Private Member Functions | |
LoadManager (Application &app, beast::Journal journal) | |
void | run () |
Private Attributes | |
Application & | app_ |
const beast::Journal | journal_ |
std::thread | thread_ |
std::mutex | mutex_ |
std::condition_variable | cv_ |
bool | stop_ = false |
std::chrono::steady_clock::time_point | deadLock_ |
bool | armed_ |
Friends | |
std::unique_ptr< LoadManager > | make_LoadManager (Application &app, beast::Journal journal) |
Manages load sources.
This object creates an associated thread to maintain a clock.
When the server is overloaded by a particular peer it issues a warning first. This allows friendly peers to reduce their consumption of resources, or disconnect from the server.
The warning system is used instead of merely dropping, because hostile peers can just reconnect anyway.
Definition at line 45 of file LoadManager.h.
|
private |
Definition at line 33 of file LoadManager.cpp.
|
delete |
|
delete |
ripple::LoadManager::~LoadManager | ( | ) |
Destroy the manager.
The destructor returns only after the thread has stopped.
Definition at line 38 of file LoadManager.cpp.
|
delete |
void ripple::LoadManager::activateDeadlockDetector | ( | ) |
Turn on deadlock detection.
The deadlock detector begins in a disabled state. After this function is called, it will report deadlocks using a separate thread whenever the reset function is not called at least once per 10 seconds.
Definition at line 55 of file LoadManager.cpp.
void ripple::LoadManager::resetDeadlockDetector | ( | ) |
Reset the deadlock detection timer.
A dedicated thread monitors the deadlock timer, and if too much time passes it will produce log warnings.
Definition at line 63 of file LoadManager.cpp.
void ripple::LoadManager::start | ( | ) |
Definition at line 73 of file LoadManager.cpp.
void ripple::LoadManager::stop | ( | ) |
Definition at line 82 of file LoadManager.cpp.
|
private |
Definition at line 100 of file LoadManager.cpp.
|
friend |
Definition at line 197 of file LoadManager.cpp.
|
private |
Definition at line 97 of file LoadManager.h.
|
private |
Definition at line 98 of file LoadManager.h.
|
private |
Definition at line 100 of file LoadManager.h.
|
private |
Definition at line 101 of file LoadManager.h.
|
private |
Definition at line 102 of file LoadManager.h.
|
private |
Definition at line 103 of file LoadManager.h.
|
private |
Definition at line 106 of file LoadManager.h.
|
private |
Definition at line 107 of file LoadManager.h.