rippled
Loading...
Searching...
No Matches
ResourceManager.h
1#ifndef XRPL_RESOURCE_MANAGER_H_INCLUDED
2#define XRPL_RESOURCE_MANAGER_H_INCLUDED
3
4#include <xrpl/beast/insight/Collector.h>
5#include <xrpl/beast/net/IPEndpoint.h>
6#include <xrpl/beast/utility/Journal.h>
7#include <xrpl/beast/utility/PropertyStream.h>
8#include <xrpl/json/json_value.h>
9#include <xrpl/resource/Consumer.h>
10#include <xrpl/resource/Gossip.h>
11
12#include <boost/utility/string_view.hpp>
13
14namespace ripple {
15namespace Resource {
16
19{
20protected:
21 Manager();
22
23public:
24 virtual ~Manager() = 0;
25
28 virtual Consumer
30 virtual Consumer
32 beast::IP::Endpoint const& address,
33 bool const proxy,
35
37 virtual Consumer
39
41 virtual Consumer
43
45 virtual Gossip
47
49 virtual Json::Value
50 getJson() = 0;
51 virtual Json::Value
52 getJson(int threshold) = 0;
53
57 virtual void
58 importConsumers(std::string const& origin, Gossip const& gossip) = 0;
59};
60
61//------------------------------------------------------------------------------
62
65 beast::insight::Collector::ptr const& collector,
66 beast::Journal journal);
67
68} // namespace Resource
69} // namespace ripple
70
71#endif
Represents a JSON value.
Definition json_value.h:130
A version-independent IP address and port combination.
Definition IPEndpoint.h:19
A generic endpoint for log messages.
Definition Journal.h:41
Subclasses can be called to write to a stream and have children.
An endpoint that consumes resources.
Definition Consumer.h:17
Tracks load and resource consumption.
virtual Consumer newInboundEndpoint(beast::IP::Endpoint const &address)=0
Create a new endpoint keyed by inbound IP address or the forwarded IP if proxied.
virtual Json::Value getJson()=0
Extract consumer information for reporting.
virtual Gossip exportConsumers()=0
Extract packaged consumer information for export.
virtual Consumer newInboundEndpoint(beast::IP::Endpoint const &address, bool const proxy, std::string_view forwardedFor)=0
virtual Consumer newUnlimitedEndpoint(beast::IP::Endpoint const &address)=0
Create a new unlimited endpoint keyed by forwarded IP.
virtual void importConsumers(std::string const &origin, Gossip const &gossip)=0
Import packaged consumer information.
virtual Json::Value getJson(int threshold)=0
virtual Consumer newOutboundEndpoint(beast::IP::Endpoint const &address)=0
Create a new endpoint keyed by outbound IP address and port.
std::unique_ptr< Manager > make_Manager(beast::insight::Collector::ptr const &collector, beast::Journal journal)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::string_view forwardedFor(http_request_type const &request)
Definition Role.cpp:243
Data format for exchanging consumption information across peers.
Definition Gossip.h:13