20 #include <ripple/basics/Log.h>
21 #include <ripple/basics/chrono.h>
22 #include <ripple/beast/core/CurrentThreadName.h>
23 #include <ripple/beast/net/IPAddressConversion.h>
24 #include <ripple/resource/ResourceManager.h>
25 #include <ripple/resource/impl/Logic.h>
26 #include <boost/asio/ip/address_v4.hpp>
27 #include <boost/core/ignore_unused.hpp>
28 #include <boost/system/error_code.hpp>
85 boost::system::error_code ec;
86 auto const proxiedIp =
87 boost::asio::ip::make_address(
forwardedFor.to_string(), ec);
93 <<
" doesn't convert to IP endpoint: " << ec.message();
179 return std::make_unique<ManagerImp>(collector, journal);
void onWrite(beast::PropertyStream::Map &map)
Consumer newInboundEndpoint(beast::IP::Endpoint const &address, bool const proxy, boost::string_view const &forwardedFor) override
Data format for exchanging consumption information across peers.
std::string to_string() const
Returns a string representing the endpoint.
Consumer newInboundEndpoint(beast::IP::Endpoint const &address)
Json::Value getJson() override
Extract consumer information for reporting.
ManagerImp(beast::insight::Collector::ptr const &collector, beast::Journal journal)
Consumer newInboundEndpoint(beast::IP::Endpoint const &address) override
Create a new endpoint keyed by inbound IP address or the forwarded IP if proxied.
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Consumer newOutboundEndpoint(beast::IP::Endpoint const &address) override
Create a new endpoint keyed by outbound IP address and port.
void importConsumers(std::string const &origin, Gossip const &gossip) override
Import packaged consumer information.
static IP::Endpoint from_asio(boost::asio::ip::address const &address)
const beast::Journal journal_
void importConsumers(std::string const &origin, Gossip const &gossip)
Gossip exportConsumers() override
Extract packaged consumer information for export.
boost::string_view forwardedFor(http_request_type const &request)
A generic endpoint for log messages.
Tracks load and resource consumption.
void setCurrentThreadName(std::string_view name)
Changes the name of the caller thread.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::unique_ptr< Manager > make_Manager(beast::insight::Collector::ptr const &collector, beast::Journal journal)
Consumer newUnlimitedEndpoint(beast::IP::Endpoint const &address)
Create endpoint that should not have resource limits applied.
ManagerImp & operator=(ManagerImp const &)=delete
An endpoint that consumes resources.
Json::Value getJson(int threshold) override
A version-independent IP address and port combination.
void onWrite(beast::PropertyStream::Map &map) override
Subclass override.
std::condition_variable cond_
Consumer newOutboundEndpoint(beast::IP::Endpoint const &address)
Consumer newUnlimitedEndpoint(beast::IP::Endpoint const &address) override
Create a new unlimited endpoint keyed by forwarded IP.