From 7c3b61bb097738888285a685cc01f87880b834e6 Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Sun, 4 May 2025 15:37:24 +0200 Subject: Add metric to track next hash expire --- src/metrics.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/metrics.c') diff --git a/src/metrics.c b/src/metrics.c index de39cdb..eb50f09 100644 --- a/src/metrics.c +++ b/src/metrics.c @@ -11,6 +11,7 @@ prom_counter_t *peers = NULL; prom_gauge_t *current_hashes = NULL; prom_counter_t *hashes = NULL; prom_counter_t *hash_expired = NULL; +prom_gauge_t *hash_next_expire = NULL; prom_counter_t *queries = NULL; prom_counter_t *requests = NULL; prom_histogram_t *offered = NULL; @@ -140,6 +141,15 @@ void metric_init() { ) ); + hash_next_expire = prom_collector_registry_must_register_metric( + prom_gauge_new( + "dht_hashes_next_expire", + "Next time a hash expires", + 0, + NULL + ) + ); + queries = prom_collector_registry_must_register_metric( prom_counter_new( "dht_queries_total", -- cgit v1.2.3