From 4fdeabaf5fa6c5c62ff5572a3215bd253a8d3ed6 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Mon, 30 Sep 2024 14:15:20 +0200 Subject: [PATCH] metrics --- node/libs/storage/src/block_store/metrics.rs | 5 ++++- node/libs/storage/src/block_store/mod.rs | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/node/libs/storage/src/block_store/metrics.rs b/node/libs/storage/src/block_store/metrics.rs index 04f87bd0..3c3107ab 100644 --- a/node/libs/storage/src/block_store/metrics.rs +++ b/node/libs/storage/src/block_store/metrics.rs @@ -13,9 +13,12 @@ pub(super) struct PersistentBlockStore { /// Latency of a successful `block()` call. #[metrics(unit = vise::Unit::Seconds, buckets = vise::Buckets::LATENCIES)] pub(super) block_latency: vise::Histogram, - /// Latency of a successful `store_next_block()` call. + /// Latency of a successful `queue_next_block()` call. #[metrics(unit = vise::Unit::Seconds, buckets = vise::Buckets::LATENCIES)] pub(super) queue_next_block_latency: vise::Histogram, + /// Latency of a successful `verify_pre_genesis_block()` call. + #[metrics(unit = vise::Unit::Seconds, buckets = vise::Buckets::LATENCIES)] + pub(super) verify_pre_genesis_block_latency: vise::Histogram, } #[vise::register] diff --git a/node/libs/storage/src/block_store/mod.rs b/node/libs/storage/src/block_store/mod.rs index e154de27..afb2f656 100644 --- a/node/libs/storage/src/block_store/mod.rs +++ b/node/libs/storage/src/block_store/mod.rs @@ -339,11 +339,12 @@ impl BlockStore { ) .into()); } - // TODO: metrics + let t = metrics::PERSISTENT_BLOCK_STORE.verify_pre_genesis_block_latency.start(); self.persistent .verify_pre_genesis_block(ctx, b) .await .context("verify_pre_genesis_block()")?; + t.observe(); } } Ok(())