WIP refactor metrics

This commit is contained in:
Dominik Werder
2025-04-10 11:59:12 +02:00
parent 34925d9ac3
commit 2e90ec19a0
12 changed files with 173 additions and 117 deletions
+3 -3
View File
@@ -121,7 +121,7 @@ impl From<&InsertQueuesTx> for InsertQueuesTxMetrics {
#[derive(Debug, Serialize)]
pub struct MetricsPrometheusShort {
counters: Vec<(String, u64)>,
counters: Vec<String>,
}
impl MetricsPrometheusShort {
@@ -129,7 +129,7 @@ impl MetricsPrometheusShort {
use std::fmt::Write;
let mut s = String::new();
for e in self.counters.iter() {
write!(&mut s, "{} {}\n", e.0, e.1).unwrap();
write!(&mut s, "{}\n", e).unwrap();
}
s
}
@@ -138,7 +138,7 @@ impl MetricsPrometheusShort {
impl From<&stats::mett::DaemonMetrics> for MetricsPrometheusShort {
fn from(value: &stats::mett::DaemonMetrics) -> Self {
Self {
counters: value.to_flatten_prometheus(),
counters: value.to_flatten_prometheus("daemon"),
}
}
}