| 
    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 45 of file LoadManager.h.
      
  | 
  private | 
Definition at line 34 of file LoadManager.cpp.
      
  | 
  delete | 
      
  | 
  delete | 
| ripple::LoadManager::~LoadManager | ( | ) | 
Destroy the manager.
The destructor returns only after the thread has stopped.
Definition at line 39 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 56 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 64 of file LoadManager.cpp.
| void ripple::LoadManager::start | ( | ) | 
Definition at line 74 of file LoadManager.cpp.
| void ripple::LoadManager::stop | ( | ) | 
Definition at line 85 of file LoadManager.cpp.
      
  | 
  private | 
Definition at line 103 of file LoadManager.cpp.
      
  | 
  friend | 
Definition at line 199 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.