mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-23 15:10:34 +00:00
feat: Add metrics around wasm calls
This commit is contained in:
@@ -90,11 +90,11 @@ private:
|
||||
acceptor_type acceptor_;
|
||||
boost::asio::strand<boost::asio::io_context::executor_type> strand_;
|
||||
bool ssl_{
|
||||
port_.protocol.count("https") > 0 || port_.protocol.count("wss") > 0 ||
|
||||
port_.protocol.count("wss2") > 0 || port_.protocol.count("peer") > 0};
|
||||
port_.protocol.contains("https") || port_.protocol.contains("wss") ||
|
||||
port_.protocol.contains("wss2") || port_.protocol.contains("peer")};
|
||||
bool plain_{
|
||||
port_.protocol.count("http") > 0 || port_.protocol.count("ws") > 0 ||
|
||||
(port_.protocol.count("ws2") != 0u)};
|
||||
port_.protocol.contains("http") || port_.protocol.contains("ws") ||
|
||||
(port_.protocol.contains("ws2"))};
|
||||
static constexpr std::chrono::milliseconds kInitialAcceptDelay{50};
|
||||
static constexpr std::chrono::milliseconds kMaxAcceptDelay{2000};
|
||||
std::chrono::milliseconds accept_delay_{kInitialAcceptDelay};
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <xrpld/app/ledger/OrderBookDBImpl.h>
|
||||
#include <xrpld/app/ledger/TransactionMaster.h>
|
||||
#include <xrpld/app/main/BasicApp.h>
|
||||
#include <xrpld/app/main/CollectorManager.h>
|
||||
#include <xrpld/app/main/GRPCServer.h>
|
||||
#include <xrpld/app/main/LoadManager.h>
|
||||
#include <xrpld/app/main/NodeIdentity.h>
|
||||
@@ -57,6 +56,7 @@
|
||||
#include <xrpl/beast/utility/PropertyStream.h>
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
#include <xrpl/core/ClosureCounter.h>
|
||||
#include <xrpl/core/CollectorManager.h>
|
||||
#include <xrpl/core/HashRouter.h>
|
||||
#include <xrpl/core/Job.h>
|
||||
#include <xrpl/core/NetworkIDService.h>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <xrpld/app/main/CollectorManager.h>
|
||||
|
||||
#include <xrpl/core/CollectorManager.h>
|
||||
|
||||
#include <xrpl/basics/BasicConfig.h>
|
||||
#include <xrpl/beast/insight/Collector.h>
|
||||
@@ -8,7 +9,6 @@
|
||||
#include <xrpl/beast/insight/StatsDCollector.h>
|
||||
#include <xrpl/beast/net/IPEndpoint.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/core/CollectorManager.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// The CollectorManager interface moved to <xrpl/core/CollectorManager.h> so it
|
||||
// is visible to libxrpl (which cannot depend on xrpld). This shim preserves the
|
||||
// historical include path for existing xrpld consumers.
|
||||
#include <xrpl/core/CollectorManager.h>
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpld/app/main/Application.h>
|
||||
#include <xrpld/app/main/CollectorManager.h>
|
||||
#include <xrpld/rpc/detail/WSInfoSub.h>
|
||||
|
||||
#include <xrpl/core/CollectorManager.h>
|
||||
#include <xrpl/core/JobQueue.h>
|
||||
#include <xrpl/json/Output.h>
|
||||
#include <xrpl/server/Server.h>
|
||||
|
||||
@@ -165,10 +165,10 @@ ServerHandler::setup(Setup const& setup, beast::Journal journal)
|
||||
port.port = endpointPort;
|
||||
|
||||
if ((setup_.client.port == 0u) &&
|
||||
(port.protocol.count("http") > 0 || port.protocol.count("https") > 0))
|
||||
(port.protocol.contains("http") || port.protocol.contains("https")))
|
||||
setup_.client.port = endpointPort;
|
||||
|
||||
if ((setup_.overlay.port() == 0u) && (port.protocol.count("peer") > 0))
|
||||
if ((setup_.overlay.port() == 0u) && (port.protocol.contains("peer")))
|
||||
setup_.overlay.port(endpointPort);
|
||||
}
|
||||
}
|
||||
@@ -217,7 +217,7 @@ ServerHandler::onHandoff(
|
||||
using namespace boost::beast;
|
||||
auto const& p{session.port().protocol};
|
||||
bool const isWs{
|
||||
p.count("ws") > 0 || p.count("ws2") > 0 || p.count("wss") > 0 || p.count("wss2") > 0};
|
||||
p.contains("ws") || p.contains("ws2") || p.contains("wss") || p.contains("wss2")};
|
||||
|
||||
if (websocket::is_upgrade(request))
|
||||
{
|
||||
@@ -251,7 +251,7 @@ ServerHandler::onHandoff(
|
||||
return handoff;
|
||||
}
|
||||
|
||||
if (bundle && p.count("peer") > 0)
|
||||
if (bundle && p.contains("peer"))
|
||||
return app_.getOverlay().onHandoff(std::move(bundle), std::move(request), remoteAddress);
|
||||
|
||||
if (isWs && isStatusRequest(request))
|
||||
@@ -301,7 +301,7 @@ void
|
||||
ServerHandler::onRequest(Session& session)
|
||||
{
|
||||
// Make sure RPC is enabled on the port
|
||||
if (session.port().protocol.count("http") == 0 && session.port().protocol.count("https") == 0)
|
||||
if (!session.port().protocol.contains("http") && !session.port().protocol.contains("https"))
|
||||
{
|
||||
httpReply(403, "Forbidden", makeOutput(session), app_.getJournal("RPC"));
|
||||
session.close(true);
|
||||
@@ -1180,7 +1180,7 @@ parsePorts(Config const& config, std::ostream& log)
|
||||
else
|
||||
{
|
||||
auto const count = std::count_if(result.cbegin(), result.cend(), [](Port const& p) {
|
||||
return p.protocol.count("peer") != 0;
|
||||
return p.protocol.contains("peer");
|
||||
});
|
||||
|
||||
if (count > 1)
|
||||
@@ -1203,12 +1203,12 @@ setupClient(ServerHandler::Setup& setup)
|
||||
decltype(setup.ports)::const_iterator iter;
|
||||
for (iter = setup.ports.cbegin(); iter != setup.ports.cend(); ++iter)
|
||||
{
|
||||
if (iter->protocol.count("http") > 0 || iter->protocol.count("https") > 0)
|
||||
if (iter->protocol.contains("http") || iter->protocol.contains("https"))
|
||||
break;
|
||||
}
|
||||
if (iter == setup.ports.cend())
|
||||
return;
|
||||
setup.client.secure = iter->protocol.count("https") > 0;
|
||||
setup.client.secure = iter->protocol.contains("https");
|
||||
if (beast::IP::isUnspecified(iter->ip))
|
||||
{
|
||||
// VFALCO HACK! to make localhost work
|
||||
@@ -1230,7 +1230,7 @@ static void
|
||||
setupOverlay(ServerHandler::Setup& setup)
|
||||
{
|
||||
auto const iter = std::ranges::find_if(
|
||||
setup.ports, [](Port const& port) { return port.protocol.count("peer") != 0; });
|
||||
setup.ports, [](Port const& port) { return port.protocol.contains("peer"); });
|
||||
if (iter == setup.ports.cend())
|
||||
{
|
||||
setup.overlay = {};
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
#include <xrpld/app/ledger/InboundLedger.h>
|
||||
#include <xrpld/app/ledger/LedgerMaster.h>
|
||||
#include <xrpld/app/main/Application.h>
|
||||
#include <xrpld/app/main/CollectorManager.h>
|
||||
#include <xrpld/app/main/Tuning.h>
|
||||
#include <xrpld/core/Config.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/basics/base_uint.h>
|
||||
#include <xrpl/basics/chrono.h>
|
||||
#include <xrpl/core/CollectorManager.h>
|
||||
#include <xrpl/shamap/FullBelowCache.h>
|
||||
#include <xrpl/shamap/TreeNodeCache.h>
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpld/app/main/CollectorManager.h>
|
||||
|
||||
#include <xrpl/core/CollectorManager.h>
|
||||
#include <xrpl/protocol/Protocol.h>
|
||||
#include <xrpl/shamap/Family.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user