From aaa4ced0cc4bff4d6e8060aa8d6f86d0bd89543c Mon Sep 17 00:00:00 2001 From: Peter Zhang Date: Thu, 21 Nov 2024 12:38:57 +0800 Subject: [PATCH] add more metrics --- node/storage/src/log_store/flow_store.rs | 8 +++++++- node/storage/src/log_store/metrics.rs | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/node/storage/src/log_store/flow_store.rs b/node/storage/src/log_store/flow_store.rs index d630e2c..ad16690 100644 --- a/node/storage/src/log_store/flow_store.rs +++ b/node/storage/src/log_store/flow_store.rs @@ -285,7 +285,10 @@ impl FlowWrite for FlowStore { } fn put_pad_data(&self, data_sizes: &[PadPair], tx_seq: u64) -> crate::error::Result<()> { - self.flow_db.put_pad_data(data_sizes, tx_seq) + let start_time = Instant::now(); + let res = self.flow_db.put_pad_data(data_sizes, tx_seq); + metrics::PUT_PAD_DATA.update_since(start_time); + res } fn put_pad_data_sync_height(&self, sync_index: u64) -> crate::error::Result<()> { @@ -295,6 +298,7 @@ impl FlowWrite for FlowStore { impl FlowSeal for FlowStore { fn pull_seal_chunk(&self, seal_index_max: usize) -> Result>> { + let start_time = Instant::now(); let to_seal_set = self.seal_manager.to_seal_set.read(); self.seal_manager.update_pull_time(); @@ -327,6 +331,8 @@ impl FlowSeal for FlowStore { }) } + metrics::PULL_SEAL_CHUNK.update_since(start_time); + Ok(Some(tasks)) } diff --git a/node/storage/src/log_store/metrics.rs b/node/storage/src/log_store/metrics.rs index 3e60ad8..13939e5 100644 --- a/node/storage/src/log_store/metrics.rs +++ b/node/storage/src/log_store/metrics.rs @@ -40,4 +40,7 @@ lazy_static::lazy_static! { pub static ref DATA_TO_MERKLE_LEAVES_SIZE: Arc> = GaugeUsize::register("log_store_data_to_merkle_leaves_size"); pub static ref TX_BY_SEQ_NUMBER: Arc = register_timer("log_store_tx_store_get_tx_by_seq_number"); + + pub static ref PULL_SEAL_CHUNK: Arc = register_timer("log_store_flow_store_pull_seal_chunks"); + pub static ref PUT_PAD_DATA: Arc = register_timer("log_store_flow_store_put_pad_data"); }