Skip to content

Commit

Permalink
add data to leaves size
Browse files Browse the repository at this point in the history
  • Loading branch information
0g-peterzhb committed Nov 1, 2024
1 parent 09bf747 commit 55a4270
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions node/storage/src/log_store/log_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 3 additions & 1 deletion node/storage/src/log_store/metrics.rs
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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");
}

0 comments on commit 55a4270

Please sign in to comment.