cat_gateway/metrics/caches/
mod.rs

1//! Metrics for Cache-related metrics.
2
3pub(crate) mod native_assets;
4pub(crate) mod rbac;
5pub(crate) mod txo_assets;
6
7/// Increment a metric value by one.
8macro_rules! cache_metric_inc {
9    ($cache:ident) => {
10        let api_host_names = Settings::api_host_names().join(",");
11        let service_id = Settings::service_id();
12        let network = Settings::cardano_network().to_string();
13
14        reporter::$cache
15            .with_label_values(&[&api_host_names, service_id, &network])
16            .inc();
17    };
18}
19
20pub(crate) use cache_metric_inc;
21
22/// Update Cache metrics
23pub(crate) fn update() {
24    native_assets::update();
25    txo_assets::update();
26    rbac::update();
27}