Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Util.hpp
1#pragma once
2
3#include "util/prometheus/Gauge.hpp"
4#include "util/prometheus/Label.hpp"
5#include "util/prometheus/Prometheus.hpp"
6
7#include <fmt/format.h>
8
9#include <string>
10
11namespace feed::impl {
12
13inline util::prometheus::GaugeInt&
14getSubscriptionsGaugeInt(std::string const& counterName)
15{
17 "subscriptions_current_number",
18 util::prometheus::Labels({util::prometheus::Label{"stream", counterName}}),
19 fmt::format("Current subscribers number on the {} stream", counterName)
20 );
21}
22} // namespace feed::impl
static util::prometheus::GaugeInt & gaugeInt(std::string name, util::prometheus::Labels labels, std::optional< std::string > description=std::nullopt)
Get an integer based gauge metric. It will be created if it doesn't exist.
Definition Prometheus.cpp:231