mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 03:35:55 +00:00
add etl info to server_info response
This commit is contained in:
@@ -130,10 +130,10 @@ private:
|
|||||||
/// server_info
|
/// server_info
|
||||||
std::chrono::time_point<std::chrono::system_clock> lastPublish_;
|
std::chrono::time_point<std::chrono::system_clock> lastPublish_;
|
||||||
|
|
||||||
std::mutex publishTimeMtx_;
|
mutable std::mutex publishTimeMtx_;
|
||||||
|
|
||||||
std::chrono::time_point<std::chrono::system_clock>
|
std::chrono::time_point<std::chrono::system_clock>
|
||||||
getLastPublish()
|
getLastPublish() const
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lck(publishTimeMtx_);
|
std::unique_lock<std::mutex> lck(publishTimeMtx_);
|
||||||
return lastPublish_;
|
return lastPublish_;
|
||||||
@@ -261,24 +261,6 @@ private:
|
|||||||
return numMarkers_;
|
return numMarkers_;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::json::object
|
|
||||||
getInfo()
|
|
||||||
{
|
|
||||||
boost::json::object result;
|
|
||||||
|
|
||||||
result["etl_sources"] = loadBalancer_->toJson();
|
|
||||||
result["is_writer"] = writing_.load();
|
|
||||||
result["read_only"] = readOnly_;
|
|
||||||
auto last = getLastPublish();
|
|
||||||
if (last.time_since_epoch().count() != 0)
|
|
||||||
result["last_publish_time"] = std::to_string(
|
|
||||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
|
||||||
std::chrono::system_clock::now() - getLastPublish())
|
|
||||||
.count());
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// start all of the necessary components and begin ETL
|
/// start all of the necessary components and begin ETL
|
||||||
void
|
void
|
||||||
run()
|
run()
|
||||||
@@ -329,6 +311,24 @@ public:
|
|||||||
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Joined ReportingETL worker thread";
|
BOOST_LOG_TRIVIAL(debug) << "Joined ReportingETL worker thread";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boost::json::object
|
||||||
|
getInfo() const
|
||||||
|
{
|
||||||
|
boost::json::object result;
|
||||||
|
|
||||||
|
result["etl_sources"] = loadBalancer_->toJson();
|
||||||
|
result["is_writer"] = writing_.load();
|
||||||
|
result["read_only"] = readOnly_;
|
||||||
|
auto last = getLastPublish();
|
||||||
|
if (last.time_since_epoch().count() != 0)
|
||||||
|
result["last_publish_time"] = std::to_string(
|
||||||
|
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||||
|
std::chrono::system_clock::now() - getLastPublish())
|
||||||
|
.count());
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ main(int argc, char* argv[])
|
|||||||
|
|
||||||
// The server handles incoming RPCs
|
// The server handles incoming RPCs
|
||||||
auto httpServer = Server::make_HttpServer(
|
auto httpServer = Server::make_HttpServer(
|
||||||
*config, ioc, ctxRef, backend, subscriptions, balancer, dosGuard);
|
*config, ioc, ctxRef, backend, subscriptions, balancer, etl, dosGuard);
|
||||||
|
|
||||||
// Blocks until stopped.
|
// Blocks until stopped.
|
||||||
// When stopped, shared_ptrs fall out of scope
|
// When stopped, shared_ptrs fall out of scope
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ make_WsContext(
|
|||||||
std::shared_ptr<BackendInterface const> const& backend,
|
std::shared_ptr<BackendInterface const> const& backend,
|
||||||
std::shared_ptr<SubscriptionManager> const& subscriptions,
|
std::shared_ptr<SubscriptionManager> const& subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> const& balancer,
|
std::shared_ptr<ETLLoadBalancer> const& balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> const& etl,
|
||||||
std::shared_ptr<WsBase> const& session,
|
std::shared_ptr<WsBase> const& session,
|
||||||
Backend::LedgerRange const& range,
|
Backend::LedgerRange const& range,
|
||||||
Counters& counters,
|
Counters& counters,
|
||||||
@@ -30,6 +31,7 @@ make_WsContext(
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
session,
|
session,
|
||||||
range,
|
range,
|
||||||
counters,
|
counters,
|
||||||
@@ -43,6 +45,7 @@ make_HttpContext(
|
|||||||
std::shared_ptr<BackendInterface const> const& backend,
|
std::shared_ptr<BackendInterface const> const& backend,
|
||||||
std::shared_ptr<SubscriptionManager> const& subscriptions,
|
std::shared_ptr<SubscriptionManager> const& subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> const& balancer,
|
std::shared_ptr<ETLLoadBalancer> const& balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> const& etl,
|
||||||
Backend::LedgerRange const& range,
|
Backend::LedgerRange const& range,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
std::string const& clientIp)
|
std::string const& clientIp)
|
||||||
@@ -74,6 +77,7 @@ make_HttpContext(
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
nullptr,
|
nullptr,
|
||||||
range,
|
range,
|
||||||
counters,
|
counters,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
class WsBase;
|
class WsBase;
|
||||||
class SubscriptionManager;
|
class SubscriptionManager;
|
||||||
class ETLLoadBalancer;
|
class ETLLoadBalancer;
|
||||||
|
class ReportingETL;
|
||||||
|
|
||||||
namespace RPC {
|
namespace RPC {
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ struct Context
|
|||||||
// SubscriptionManager as a weak_ptr, to prevent a shared_ptr cycle.
|
// SubscriptionManager as a weak_ptr, to prevent a shared_ptr cycle.
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions;
|
std::shared_ptr<SubscriptionManager> subscriptions;
|
||||||
std::shared_ptr<ETLLoadBalancer> const& balancer;
|
std::shared_ptr<ETLLoadBalancer> const& balancer;
|
||||||
|
std::shared_ptr<ReportingETL const> const& etl;
|
||||||
std::shared_ptr<WsBase> session;
|
std::shared_ptr<WsBase> session;
|
||||||
Backend::LedgerRange const& range;
|
Backend::LedgerRange const& range;
|
||||||
Counters& counters;
|
Counters& counters;
|
||||||
@@ -51,6 +53,7 @@ struct Context
|
|||||||
std::shared_ptr<BackendInterface const> const& backend_,
|
std::shared_ptr<BackendInterface const> const& backend_,
|
||||||
std::shared_ptr<SubscriptionManager> const& subscriptions_,
|
std::shared_ptr<SubscriptionManager> const& subscriptions_,
|
||||||
std::shared_ptr<ETLLoadBalancer> const& balancer_,
|
std::shared_ptr<ETLLoadBalancer> const& balancer_,
|
||||||
|
std::shared_ptr<ReportingETL const> const& etl_,
|
||||||
std::shared_ptr<WsBase> const& session_,
|
std::shared_ptr<WsBase> const& session_,
|
||||||
Backend::LedgerRange const& range_,
|
Backend::LedgerRange const& range_,
|
||||||
Counters& counters_,
|
Counters& counters_,
|
||||||
@@ -62,6 +65,7 @@ struct Context
|
|||||||
, backend(backend_)
|
, backend(backend_)
|
||||||
, subscriptions(subscriptions_)
|
, subscriptions(subscriptions_)
|
||||||
, balancer(balancer_)
|
, balancer(balancer_)
|
||||||
|
, etl(etl_)
|
||||||
, session(session_)
|
, session(session_)
|
||||||
, range(range_)
|
, range(range_)
|
||||||
, counters(counters_)
|
, counters(counters_)
|
||||||
@@ -144,6 +148,7 @@ make_WsContext(
|
|||||||
std::shared_ptr<BackendInterface const> const& backend,
|
std::shared_ptr<BackendInterface const> const& backend,
|
||||||
std::shared_ptr<SubscriptionManager> const& subscriptions,
|
std::shared_ptr<SubscriptionManager> const& subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> const& balancer,
|
std::shared_ptr<ETLLoadBalancer> const& balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> const& etl,
|
||||||
std::shared_ptr<WsBase> const& session,
|
std::shared_ptr<WsBase> const& session,
|
||||||
Backend::LedgerRange const& range,
|
Backend::LedgerRange const& range,
|
||||||
Counters& counters,
|
Counters& counters,
|
||||||
@@ -156,6 +161,7 @@ make_HttpContext(
|
|||||||
std::shared_ptr<BackendInterface const> const& backend,
|
std::shared_ptr<BackendInterface const> const& backend,
|
||||||
std::shared_ptr<SubscriptionManager> const& subscriptions,
|
std::shared_ptr<SubscriptionManager> const& subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> const& balancer,
|
std::shared_ptr<ETLLoadBalancer> const& balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> const& etl,
|
||||||
Backend::LedgerRange const& range,
|
Backend::LedgerRange const& range,
|
||||||
Counters& counters,
|
Counters& counters,
|
||||||
std::string const& clientIp);
|
std::string const& clientIp);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
#include <backend/BackendInterface.h>
|
#include <backend/BackendInterface.h>
|
||||||
#include <etl/ETLSource.h>
|
#include <etl/ETLSource.h>
|
||||||
|
#include <etl/ReportingETL.h>
|
||||||
#include <rpc/RPCHelpers.h>
|
#include <rpc/RPCHelpers.h>
|
||||||
|
|
||||||
namespace RPC {
|
namespace RPC {
|
||||||
@@ -35,6 +36,8 @@ doServerInfo(Context const& context)
|
|||||||
cache["latest_ledger_seq"] =
|
cache["latest_ledger_seq"] =
|
||||||
context.backend->cache().latestLedgerSequence();
|
context.backend->cache().latestLedgerSequence();
|
||||||
|
|
||||||
|
response["etl"] = context.etl->getInfo();
|
||||||
|
|
||||||
auto serverInfoRippled = context.balancer->forwardToRippled(
|
auto serverInfoRippled = context.balancer->forwardToRippled(
|
||||||
context.params, context.clientIp, context.yield);
|
context.params, context.clientIp, context.yield);
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ class HttpBase
|
|||||||
std::shared_ptr<BackendInterface const> backend_;
|
std::shared_ptr<BackendInterface const> backend_;
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions_;
|
std::shared_ptr<SubscriptionManager> subscriptions_;
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer_;
|
std::shared_ptr<ETLLoadBalancer> balancer_;
|
||||||
|
std::shared_ptr<ReportingETL const> etl_;
|
||||||
DOSGuard& dosGuard_;
|
DOSGuard& dosGuard_;
|
||||||
RPC::Counters& counters_;
|
RPC::Counters& counters_;
|
||||||
send_lambda lambda_;
|
send_lambda lambda_;
|
||||||
@@ -124,6 +125,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer buffer)
|
boost::beast::flat_buffer buffer)
|
||||||
@@ -131,6 +133,7 @@ public:
|
|||||||
, backend_(backend)
|
, backend_(backend)
|
||||||
, subscriptions_(subscriptions)
|
, subscriptions_(subscriptions)
|
||||||
, balancer_(balancer)
|
, balancer_(balancer)
|
||||||
|
, etl_(etl)
|
||||||
, dosGuard_(dosGuard)
|
, dosGuard_(dosGuard)
|
||||||
, counters_(counters)
|
, counters_(counters)
|
||||||
, lambda_(*this)
|
, lambda_(*this)
|
||||||
@@ -183,6 +186,7 @@ public:
|
|||||||
backend_,
|
backend_,
|
||||||
subscriptions_,
|
subscriptions_,
|
||||||
balancer_,
|
balancer_,
|
||||||
|
etl_,
|
||||||
dosGuard_,
|
dosGuard_,
|
||||||
counters_);
|
counters_);
|
||||||
}
|
}
|
||||||
@@ -201,6 +205,7 @@ public:
|
|||||||
lambda_,
|
lambda_,
|
||||||
backend_,
|
backend_,
|
||||||
balancer_,
|
balancer_,
|
||||||
|
etl_,
|
||||||
dosGuard_,
|
dosGuard_,
|
||||||
counters_,
|
counters_,
|
||||||
ip,
|
ip,
|
||||||
@@ -247,6 +252,7 @@ handle_request(
|
|||||||
Send&& send,
|
Send&& send,
|
||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
std::string const& ip,
|
std::string const& ip,
|
||||||
@@ -319,7 +325,7 @@ handle_request(
|
|||||||
RPC::make_error(RPC::Error::rpcNOT_READY))));
|
RPC::make_error(RPC::Error::rpcNOT_READY))));
|
||||||
|
|
||||||
std::optional<RPC::Context> context = RPC::make_HttpContext(
|
std::optional<RPC::Context> context = RPC::make_HttpContext(
|
||||||
yc, request, backend, nullptr, balancer, *range, counters, ip);
|
yc, request, backend, nullptr, balancer, etl, *range, counters, ip);
|
||||||
|
|
||||||
if (!context)
|
if (!context)
|
||||||
return send(httpResponse(
|
return send(httpResponse(
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer buffer)
|
boost::beast::flat_buffer buffer)
|
||||||
@@ -30,6 +31,7 @@ public:
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
dosGuard,
|
dosGuard,
|
||||||
counters,
|
counters,
|
||||||
std::move(buffer))
|
std::move(buffer))
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class Detector
|
|||||||
std::shared_ptr<BackendInterface const> backend_;
|
std::shared_ptr<BackendInterface const> backend_;
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions_;
|
std::shared_ptr<SubscriptionManager> subscriptions_;
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer_;
|
std::shared_ptr<ETLLoadBalancer> balancer_;
|
||||||
|
std::shared_ptr<ReportingETL const> etl_;
|
||||||
DOSGuard& dosGuard_;
|
DOSGuard& dosGuard_;
|
||||||
RPC::Counters& counters_;
|
RPC::Counters& counters_;
|
||||||
boost::beast::flat_buffer buffer_;
|
boost::beast::flat_buffer buffer_;
|
||||||
@@ -39,6 +40,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters)
|
RPC::Counters& counters)
|
||||||
: ioc_(ioc)
|
: ioc_(ioc)
|
||||||
@@ -47,6 +49,7 @@ public:
|
|||||||
, backend_(backend)
|
, backend_(backend)
|
||||||
, subscriptions_(subscriptions)
|
, subscriptions_(subscriptions)
|
||||||
, balancer_(balancer)
|
, balancer_(balancer)
|
||||||
|
, etl_(etl)
|
||||||
, dosGuard_(dosGuard)
|
, dosGuard_(dosGuard)
|
||||||
, counters_(counters)
|
, counters_(counters)
|
||||||
{
|
{
|
||||||
@@ -85,6 +88,7 @@ public:
|
|||||||
backend_,
|
backend_,
|
||||||
subscriptions_,
|
subscriptions_,
|
||||||
balancer_,
|
balancer_,
|
||||||
|
etl_,
|
||||||
dosGuard_,
|
dosGuard_,
|
||||||
counters_,
|
counters_,
|
||||||
std::move(buffer_))
|
std::move(buffer_))
|
||||||
@@ -99,6 +103,7 @@ public:
|
|||||||
backend_,
|
backend_,
|
||||||
subscriptions_,
|
subscriptions_,
|
||||||
balancer_,
|
balancer_,
|
||||||
|
etl_,
|
||||||
dosGuard_,
|
dosGuard_,
|
||||||
counters_,
|
counters_,
|
||||||
std::move(buffer_))
|
std::move(buffer_))
|
||||||
@@ -115,6 +120,7 @@ make_websocket_session(
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters)
|
RPC::Counters& counters)
|
||||||
{
|
{
|
||||||
@@ -124,6 +130,7 @@ make_websocket_session(
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
dosGuard,
|
dosGuard,
|
||||||
counters,
|
counters,
|
||||||
std::move(buffer),
|
std::move(buffer),
|
||||||
@@ -140,6 +147,7 @@ make_websocket_session(
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters)
|
RPC::Counters& counters)
|
||||||
{
|
{
|
||||||
@@ -149,6 +157,7 @@ make_websocket_session(
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
dosGuard,
|
dosGuard,
|
||||||
counters,
|
counters,
|
||||||
std::move(buffer),
|
std::move(buffer),
|
||||||
@@ -169,6 +178,7 @@ class Listener
|
|||||||
std::shared_ptr<BackendInterface const> backend_;
|
std::shared_ptr<BackendInterface const> backend_;
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions_;
|
std::shared_ptr<SubscriptionManager> subscriptions_;
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer_;
|
std::shared_ptr<ETLLoadBalancer> balancer_;
|
||||||
|
std::shared_ptr<ReportingETL const> etl_;
|
||||||
DOSGuard& dosGuard_;
|
DOSGuard& dosGuard_;
|
||||||
RPC::Counters counters_;
|
RPC::Counters counters_;
|
||||||
|
|
||||||
@@ -180,6 +190,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard)
|
DOSGuard& dosGuard)
|
||||||
: ioc_(ioc)
|
: ioc_(ioc)
|
||||||
, ctx_(ctx)
|
, ctx_(ctx)
|
||||||
@@ -187,6 +198,7 @@ public:
|
|||||||
, backend_(backend)
|
, backend_(backend)
|
||||||
, subscriptions_(subscriptions)
|
, subscriptions_(subscriptions)
|
||||||
, balancer_(balancer)
|
, balancer_(balancer)
|
||||||
|
, etl_(etl)
|
||||||
, dosGuard_(dosGuard)
|
, dosGuard_(dosGuard)
|
||||||
{
|
{
|
||||||
boost::beast::error_code ec;
|
boost::beast::error_code ec;
|
||||||
@@ -263,6 +275,7 @@ private:
|
|||||||
backend_,
|
backend_,
|
||||||
subscriptions_,
|
subscriptions_,
|
||||||
balancer_,
|
balancer_,
|
||||||
|
etl_,
|
||||||
dosGuard_,
|
dosGuard_,
|
||||||
counters_)
|
counters_)
|
||||||
->run();
|
->run();
|
||||||
@@ -286,6 +299,7 @@ make_HttpServer(
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard)
|
DOSGuard& dosGuard)
|
||||||
{
|
{
|
||||||
if (!config.contains("server"))
|
if (!config.contains("server"))
|
||||||
@@ -305,6 +319,7 @@ make_HttpServer(
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
dosGuard);
|
dosGuard);
|
||||||
|
|
||||||
server->run();
|
server->run();
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer&& buffer)
|
boost::beast::flat_buffer&& buffer)
|
||||||
@@ -43,6 +44,7 @@ public:
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
dosGuard,
|
dosGuard,
|
||||||
counters,
|
counters,
|
||||||
std::move(buffer))
|
std::move(buffer))
|
||||||
@@ -79,6 +81,7 @@ class WsUpgrader : public std::enable_shared_from_this<WsUpgrader>
|
|||||||
std::shared_ptr<BackendInterface const> backend_;
|
std::shared_ptr<BackendInterface const> backend_;
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions_;
|
std::shared_ptr<SubscriptionManager> subscriptions_;
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer_;
|
std::shared_ptr<ETLLoadBalancer> balancer_;
|
||||||
|
std::shared_ptr<ReportingETL const> etl_;
|
||||||
DOSGuard& dosGuard_;
|
DOSGuard& dosGuard_;
|
||||||
RPC::Counters& counters_;
|
RPC::Counters& counters_;
|
||||||
http::request<http::string_body> req_;
|
http::request<http::string_body> req_;
|
||||||
@@ -90,6 +93,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer&& b)
|
boost::beast::flat_buffer&& b)
|
||||||
@@ -99,6 +103,7 @@ public:
|
|||||||
, backend_(backend)
|
, backend_(backend)
|
||||||
, subscriptions_(subscriptions)
|
, subscriptions_(subscriptions)
|
||||||
, balancer_(balancer)
|
, balancer_(balancer)
|
||||||
|
, etl_(etl)
|
||||||
, dosGuard_(dosGuard)
|
, dosGuard_(dosGuard)
|
||||||
, counters_(counters)
|
, counters_(counters)
|
||||||
{
|
{
|
||||||
@@ -109,6 +114,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer&& b,
|
boost::beast::flat_buffer&& b,
|
||||||
@@ -119,6 +125,7 @@ public:
|
|||||||
, backend_(backend)
|
, backend_(backend)
|
||||||
, subscriptions_(subscriptions)
|
, subscriptions_(subscriptions)
|
||||||
, balancer_(balancer)
|
, balancer_(balancer)
|
||||||
|
, etl_(etl)
|
||||||
, dosGuard_(dosGuard)
|
, dosGuard_(dosGuard)
|
||||||
, counters_(counters)
|
, counters_(counters)
|
||||||
, req_(std::move(req))
|
, req_(std::move(req))
|
||||||
@@ -173,6 +180,7 @@ private:
|
|||||||
backend_,
|
backend_,
|
||||||
subscriptions_,
|
subscriptions_,
|
||||||
balancer_,
|
balancer_,
|
||||||
|
etl_,
|
||||||
dosGuard_,
|
dosGuard_,
|
||||||
counters_,
|
counters_,
|
||||||
std::move(buffer_))
|
std::move(buffer_))
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer buffer)
|
boost::beast::flat_buffer buffer)
|
||||||
@@ -31,6 +32,7 @@ public:
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
dosGuard,
|
dosGuard,
|
||||||
counters,
|
counters,
|
||||||
std::move(buffer))
|
std::move(buffer))
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer&& b)
|
boost::beast::flat_buffer&& b)
|
||||||
@@ -41,6 +42,7 @@ public:
|
|||||||
backend,
|
backend,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
balancer,
|
balancer,
|
||||||
|
etl,
|
||||||
dosGuard,
|
dosGuard,
|
||||||
counters,
|
counters,
|
||||||
std::move(b))
|
std::move(b))
|
||||||
@@ -75,6 +77,7 @@ class SslWsUpgrader : public std::enable_shared_from_this<SslWsUpgrader>
|
|||||||
std::shared_ptr<BackendInterface const> backend_;
|
std::shared_ptr<BackendInterface const> backend_;
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions_;
|
std::shared_ptr<SubscriptionManager> subscriptions_;
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer_;
|
std::shared_ptr<ETLLoadBalancer> balancer_;
|
||||||
|
std::shared_ptr<ReportingETL const> etl_;
|
||||||
DOSGuard& dosGuard_;
|
DOSGuard& dosGuard_;
|
||||||
RPC::Counters& counters_;
|
RPC::Counters& counters_;
|
||||||
http::request<http::string_body> req_;
|
http::request<http::string_body> req_;
|
||||||
@@ -87,6 +90,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer&& b)
|
boost::beast::flat_buffer&& b)
|
||||||
@@ -96,6 +100,7 @@ public:
|
|||||||
, backend_(backend)
|
, backend_(backend)
|
||||||
, subscriptions_(subscriptions)
|
, subscriptions_(subscriptions)
|
||||||
, balancer_(balancer)
|
, balancer_(balancer)
|
||||||
|
, etl_(etl)
|
||||||
, dosGuard_(dosGuard)
|
, dosGuard_(dosGuard)
|
||||||
, counters_(counters)
|
, counters_(counters)
|
||||||
{
|
{
|
||||||
@@ -106,6 +111,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer&& b,
|
boost::beast::flat_buffer&& b,
|
||||||
@@ -116,6 +122,7 @@ public:
|
|||||||
, backend_(backend)
|
, backend_(backend)
|
||||||
, subscriptions_(subscriptions)
|
, subscriptions_(subscriptions)
|
||||||
, balancer_(balancer)
|
, balancer_(balancer)
|
||||||
|
, etl_(etl)
|
||||||
, dosGuard_(dosGuard)
|
, dosGuard_(dosGuard)
|
||||||
, counters_(counters)
|
, counters_(counters)
|
||||||
, req_(std::move(req))
|
, req_(std::move(req))
|
||||||
@@ -185,6 +192,7 @@ private:
|
|||||||
backend_,
|
backend_,
|
||||||
subscriptions_,
|
subscriptions_,
|
||||||
balancer_,
|
balancer_,
|
||||||
|
etl_,
|
||||||
dosGuard_,
|
dosGuard_,
|
||||||
counters_,
|
counters_,
|
||||||
std::move(buffer_))
|
std::move(buffer_))
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ class WsSession : public WsBase,
|
|||||||
// a cyclical dependency that would block destruction
|
// a cyclical dependency that would block destruction
|
||||||
std::weak_ptr<SubscriptionManager> subscriptions_;
|
std::weak_ptr<SubscriptionManager> subscriptions_;
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer_;
|
std::shared_ptr<ETLLoadBalancer> balancer_;
|
||||||
|
std::shared_ptr<ReportingETL const> etl_;
|
||||||
DOSGuard& dosGuard_;
|
DOSGuard& dosGuard_;
|
||||||
RPC::Counters& counters_;
|
RPC::Counters& counters_;
|
||||||
std::mutex mtx_;
|
std::mutex mtx_;
|
||||||
@@ -98,6 +99,7 @@ public:
|
|||||||
std::shared_ptr<BackendInterface const> backend,
|
std::shared_ptr<BackendInterface const> backend,
|
||||||
std::shared_ptr<SubscriptionManager> subscriptions,
|
std::shared_ptr<SubscriptionManager> subscriptions,
|
||||||
std::shared_ptr<ETLLoadBalancer> balancer,
|
std::shared_ptr<ETLLoadBalancer> balancer,
|
||||||
|
std::shared_ptr<ReportingETL const> etl,
|
||||||
DOSGuard& dosGuard,
|
DOSGuard& dosGuard,
|
||||||
RPC::Counters& counters,
|
RPC::Counters& counters,
|
||||||
boost::beast::flat_buffer&& buffer)
|
boost::beast::flat_buffer&& buffer)
|
||||||
@@ -106,6 +108,7 @@ public:
|
|||||||
, backend_(backend)
|
, backend_(backend)
|
||||||
, subscriptions_(subscriptions)
|
, subscriptions_(subscriptions)
|
||||||
, balancer_(balancer)
|
, balancer_(balancer)
|
||||||
|
, etl_(etl)
|
||||||
, dosGuard_(dosGuard)
|
, dosGuard_(dosGuard)
|
||||||
, counters_(counters)
|
, counters_(counters)
|
||||||
{
|
{
|
||||||
@@ -231,6 +234,7 @@ public:
|
|||||||
backend_,
|
backend_,
|
||||||
subscriptions_.lock(),
|
subscriptions_.lock(),
|
||||||
balancer_,
|
balancer_,
|
||||||
|
etl_,
|
||||||
shared_from_this(),
|
shared_from_this(),
|
||||||
*range,
|
*range,
|
||||||
counters_,
|
counters_,
|
||||||
|
|||||||
Reference in New Issue
Block a user