add data to leaves size

This commit is contained in:
Peter Zhang 2024-11-01 11:13:18 +08:00
parent 09bf7471b9
commit 55a4270623
2 changed files with 4 additions and 1 deletions

View File

@ -1263,6 +1263,7 @@ pub fn data_to_merkle_leaves(leaf_data: &[u8]) -> Result<Vec<H256>> {
.collect()
};
metrics::DATA_TO_MERKLE_LEAVES_SIZE.update(leaf_data.len() as usize);
metrics::DATA_TO_MERKLE_LEAVES.update_since(start_time);
Ok(r)
}

View File

@ -1,6 +1,6 @@
use std::sync::Arc;
use metrics::{register_timer, Timer};
use metrics::{register_timer, Gauge, GaugeUsize, Timer};
lazy_static::lazy_static! {
pub static ref PUT_TX: Arc<dyn Timer> = register_timer("log_store_put_tx");
@ -36,4 +36,6 @@ lazy_static::lazy_static! {
pub static ref APPEND_ENTRIES: Arc<dyn Timer> = register_timer("log_store_flow_store_append_entries");
pub static ref FINALIZE_TX_WITH_HASH: Arc<dyn Timer> = register_timer("log_store_log_manager_finalize_tx_with_hash");
pub static ref DATA_TO_MERKLE_LEAVES_SIZE: Arc<dyn Gauge<usize>> = GaugeUsize::register("log_store_data_to_merkle_leaves_size");
}