|
rippled
|
Manages load sources. More...
#include <LoadManager.h>

Public Member Functions | |
| LoadManager ()=delete | |
| LoadManager (LoadManager const &)=delete | |
| LoadManager & | operator= (LoadManager const &)=delete |
| ~LoadManager () | |
| Destroy the manager. | |
| void | activateStallDetector () |
| Turn on stall detection. | |
| void | heartbeat () |
| Reset the stall detection timer. | |
| void | start () |
| void | stop () |
Private Member Functions | |
| LoadManager (Application &app, beast::Journal journal) | |
| void | run () |
Private Attributes | |
| Application & | app_ |
| beast::Journal const | journal_ |
| std::thread | thread_ |
| std::mutex | mutex_ |
| std::condition_variable | cv_ |
| bool | stop_ = false |
| std::chrono::steady_clock::time_point | lastHeartbeat_ |
| 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 26 of file LoadManager.h.
|
private |
Definition at line 15 of file LoadManager.cpp.
|
delete |
|
delete |
| ripple::LoadManager::~LoadManager | ( | ) |
Destroy the manager.
The destructor returns only after the thread has stopped.
Definition at line 20 of file LoadManager.cpp.
|
delete |
| void ripple::LoadManager::activateStallDetector | ( | ) |
Turn on stall detection.
The stall detector begins in a disabled state. After this function is called, it will report stalls using a separate thread whenever the reset function is not called at least once per 10 seconds.
Definition at line 37 of file LoadManager.cpp.
| void ripple::LoadManager::heartbeat | ( | ) |
Reset the stall detection timer.
A dedicated thread monitors the stall timer, and if too much time passes it will produce log warnings.
Definition at line 45 of file LoadManager.cpp.
| void ripple::LoadManager::start | ( | ) |
Definition at line 55 of file LoadManager.cpp.
| void ripple::LoadManager::stop | ( | ) |
Definition at line 66 of file LoadManager.cpp.
|
private |
Definition at line 84 of file LoadManager.cpp.
|
friend |
Definition at line 180 of file LoadManager.cpp.
|
private |
Definition at line 78 of file LoadManager.h.
|
private |
Definition at line 79 of file LoadManager.h.
|
private |
Definition at line 81 of file LoadManager.h.
|
private |
Definition at line 82 of file LoadManager.h.
|
private |
Definition at line 83 of file LoadManager.h.
|
private |
Definition at line 84 of file LoadManager.h.
|
private |
Definition at line 87 of file LoadManager.h.
|
private |
Definition at line 88 of file LoadManager.h.