mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-26 06:35:53 +00:00
feat: Add load balancer prometheus metrics (#2096)
Fix: https://github.com/XRPLF/clio/issues/2070
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
#include "util/ResponseExpirationCache.hpp"
|
||||
#include "util/log/Logger.hpp"
|
||||
#include "util/newconfig/ConfigDefinition.hpp"
|
||||
#include "util/prometheus/Counter.hpp"
|
||||
#include "util/prometheus/Histogram.hpp"
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
@@ -92,7 +94,12 @@ private:
|
||||
std::uint32_t downloadRanges_ =
|
||||
kDEFAULT_DOWNLOAD_RANGES; /*< The number of markers to use when downloading initial ledger */
|
||||
|
||||
// Using mutext instead of atomic_bool because choosing a new source to
|
||||
std::reference_wrapper<util::prometheus::HistogramInt> forwardedDurationHistogram_;
|
||||
std::reference_wrapper<util::prometheus::CounterInt> forwardedRetryCounter_;
|
||||
std::reference_wrapper<util::prometheus::CounterInt> cacheTriedCounter_;
|
||||
std::reference_wrapper<util::prometheus::CounterInt> cacheMissCounter_;
|
||||
|
||||
// Using mutex instead of atomic_bool because choosing a new source to
|
||||
// forward messages should be done with a mutual exclusion otherwise there will be a race condition
|
||||
util::Mutex<bool> hasForwardingSource_{false};
|
||||
|
||||
@@ -133,7 +140,7 @@ public:
|
||||
* @param ioc The io_context to run on
|
||||
* @param backend BackendInterface implementation
|
||||
* @param subscriptions Subscription manager
|
||||
* @param validatedLedgers The network validated ledgers datastructure
|
||||
* @param validatedLedgers The network validated ledgers data structure
|
||||
* @param sourceFactory A factory function to create a source
|
||||
* @return A shared pointer to a new instance of LoadBalancer
|
||||
*/
|
||||
@@ -147,8 +154,6 @@ public:
|
||||
SourceFactory sourceFactory = makeSource
|
||||
);
|
||||
|
||||
~LoadBalancer() override;
|
||||
|
||||
/**
|
||||
* @brief Load the initial ledger, writing data to the queue.
|
||||
* @note This function will retry indefinitely until the ledger is downloaded.
|
||||
|
||||
Reference in New Issue
Block a user