rippled
Loading...
Searching...
No Matches
ResourceManager.h
1#pragma once
2
3#include <xrpl/beast/insight/Collector.h>
4#include <xrpl/beast/net/IPEndpoint.h>
5#include <xrpl/beast/utility/Journal.h>
6#include <xrpl/beast/utility/PropertyStream.h>
7#include <xrpl/json/json_value.h>
8#include <xrpl/resource/Consumer.h>
9#include <xrpl/resource/Gossip.h>
10
11#include <boost/utility/string_view.hpp>
12
13namespace xrpl {
14namespace Resource {
15
18{
19protected:
20 Manager();
21
22public:
23 virtual ~Manager() = 0;
24
27 virtual Consumer
29 virtual Consumer
31
33 virtual Consumer
35
37 virtual Consumer
39
41 virtual Gossip
43
45 virtual Json::Value
46 getJson() = 0;
47 virtual Json::Value
48 getJson(int threshold) = 0;
49
53 virtual void
54 importConsumers(std::string const& origin, Gossip const& gossip) = 0;
55};
56
57//------------------------------------------------------------------------------
58
61
62} // namespace Resource
63} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
A version-independent IP address and port combination.
Definition IPEndpoint.h:18
A generic endpoint for log messages.
Definition Journal.h:40
Subclasses can be called to write to a stream and have children.
An endpoint that consumes resources.
Definition Consumer.h:16
Tracks load and resource consumption.
virtual Json::Value getJson()=0
Extract consumer information for reporting.
virtual Json::Value getJson(int threshold)=0
virtual Gossip exportConsumers()=0
Extract packaged consumer information for export.
virtual Consumer newUnlimitedEndpoint(beast::IP::Endpoint const &address)=0
Create a new unlimited endpoint keyed by forwarded IP.
virtual Consumer newOutboundEndpoint(beast::IP::Endpoint const &address)=0
Create a new endpoint keyed by outbound IP address and port.
virtual void importConsumers(std::string const &origin, Gossip const &gossip)=0
Import packaged consumer information.
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 Consumer newInboundEndpoint(beast::IP::Endpoint const &address, bool const proxy, std::string_view forwardedFor)=0
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:5
std::string_view forwardedFor(http_request_type const &request)
Definition Role.cpp:228
Data format for exchanging consumption information across peers.
Definition Gossip.h:12