mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-30 16:45:51 +00:00
feat: Expose ledger cache full and disabled to prometheus (#1957)
Fixes #1771
This commit is contained in:
@@ -158,9 +158,9 @@ struct MockPrometheusImpl : PrometheusInterface {
|
||||
{
|
||||
std::unique_ptr<MetricBase> metric;
|
||||
auto const key = name + labelsString;
|
||||
if constexpr (std::is_same_v<MetricType, GaugeInt>) {
|
||||
if constexpr (std::is_same_v<MetricType, GaugeInt> or std::is_same_v<MetricType, Bool>) {
|
||||
auto& impl = counterIntImpls[key];
|
||||
metric = std::make_unique<MetricType>(name, labelsString, impl);
|
||||
metric = std::make_unique<GaugeInt>(name, labelsString, impl);
|
||||
} else if constexpr (std::is_same_v<MetricType, CounterInt>) {
|
||||
auto& impl = counterUintImpls[key];
|
||||
metric = std::make_unique<MetricType>(name, labelsString, impl);
|
||||
@@ -235,7 +235,7 @@ struct WithMockPrometheus : virtual ::testing::Test {
|
||||
if (!mockPrometheusPtr->metrics.contains(key))
|
||||
mockPrometheusPtr->makeMetric<MetricType>(std::move(name), std::move(labelsString));
|
||||
|
||||
if constexpr (std::is_same_v<MetricType, GaugeInt>) {
|
||||
if constexpr (std::is_same_v<MetricType, GaugeInt> or std::is_same_v<MetricType, Bool>) {
|
||||
return mockPrometheusPtr->counterIntImpls[key];
|
||||
} else if constexpr (std::is_same_v<MetricType, CounterInt>) {
|
||||
return mockPrometheusPtr->counterUintImpls[key];
|
||||
|
||||
Reference in New Issue
Block a user