Skip to content

Commit b02acbf

Browse files
committed
chore: document better
1 parent 66e895c commit b02acbf

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

crates/block-processor/src/metrics.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
//! Metrics to track
22
//!
33
//! - Counters:
4+
//! - Number of builder blocks extracted
45
//! - Number of builder blocks processed
56
//! - Number of transactions processed
6-
//! - slots without builder blocks
7+
//! - Host blocks without builder blocks
78
//! - Histograms:
8-
//! - slots since last builder block
9+
//! - enter events extracted per block
10+
//! - enter token events extracted per block
11+
//! - transact events extracted per block
12+
//! - enter events processed per block
13+
//! - enter token events processed per block
14+
//! - transact events processed
915
//! - Transaction counts per builder block
1016
1117
use metrics::{Counter, Histogram, counter, describe_counter, describe_histogram, histogram};
@@ -23,8 +29,8 @@ const BLOCKS_PROCESSED_HELP: &str = "Number of signet blocks processed";
2329
const TRANSACTIONS_PROCESSED: &str = "signet.block_processor.transactions_processed";
2430
const TRANSACTIONS_PROCESSED_HELP: &str = "Number of transactions processed in signet blocks";
2531

26-
const SLOTS_WITHOUT_BUILDER_BLOCK: &str = "signet.block_processor.slots_without_builder_block";
27-
const SLOTS_WITHOUT_BUILDER_BLOCK_HELP: &str = "Number of slots without builder blocks";
32+
const HOST_WITHOUT_BUILDER_BLOCK: &str = "signet.block_processor.host_without_builder_block";
33+
const HOST_WITHOUT_BUILDER_BLOCK_HELP: &str = "Number of host blocks without builder blocks";
2834

2935
const TRANSACTIONS_PER_BUILDER_BLOCK: &str = "signet.block_processor.txns_per_builder_block";
3036
const TRANSACTIONS_PER_BUILDER_BLOCK_HELP: &str =
@@ -54,7 +60,7 @@ static DESCRIBE: LazyLock<()> = LazyLock::new(|| {
5460
describe_counter!(BUILDER_BLOCKS_EXTRACTED, BUILDER_BLOCKS_EXTRACTED_HELP);
5561
describe_counter!(BLOCKS_PROCESSED, BLOCKS_PROCESSED_HELP);
5662
describe_counter!(TRANSACTIONS_PROCESSED, TRANSACTIONS_PROCESSED_HELP);
57-
describe_counter!(SLOTS_WITHOUT_BUILDER_BLOCK, SLOTS_WITHOUT_BUILDER_BLOCK_HELP);
63+
describe_counter!(HOST_WITHOUT_BUILDER_BLOCK, HOST_WITHOUT_BUILDER_BLOCK_HELP);
5864

5965
describe_histogram!(TRANSACTIONS_PER_BUILDER_BLOCK, TRANSACTIONS_PER_BUILDER_BLOCK_HELP);
6066
describe_histogram!(TRANSACT_EXTRACTS, TRANSACT_EXTRACTS_HELP);
@@ -92,13 +98,13 @@ fn inc_transactions_processed(value: u64) {
9298
transactions_processed().increment(value);
9399
}
94100

95-
fn slots_without_builder_block() -> Counter {
101+
fn host_without_builder_block() -> Counter {
96102
LazyLock::force(&DESCRIBE);
97-
counter!(SLOTS_WITHOUT_BUILDER_BLOCK)
103+
counter!(HOST_WITHOUT_BUILDER_BLOCK)
98104
}
99105

100-
fn inc_slots_without_builder_block() {
101-
slots_without_builder_block().increment(1);
106+
fn inc_host_without_builder_block() {
107+
host_without_builder_block().increment(1);
102108
}
103109

104110
fn transactions_per_builder_block() -> Histogram {
@@ -172,7 +178,7 @@ pub(crate) fn record_extracts<T: Extractable>(extracts: &Extracts<'_, T>) {
172178
if extracts.events.submitted.is_some() {
173179
inc_blocks_extracted();
174180
} else {
175-
inc_slots_without_builder_block();
181+
inc_host_without_builder_block();
176182
}
177183
}
178184

crates/node/src/metrics.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
use std::sync::LazyLock;
1+
//! Metrics to track
2+
//!
3+
//! - Counters
4+
//! - Number of notifications received
5+
//! - Number of reorgs received
6+
//! - Number of notifications processed
7+
//! - Number of reorgs processed
28
39
use metrics::{Counter, counter, describe_counter};
410
use reth_exex::ExExNotification;
11+
use std::sync::LazyLock;
512

613
const NOTIFICATION_RECEIVED: &str = "signet.node.notification_received";
714
const NOTIFICATION_RECEIVED_HELP: &str = "Number of notifications received";

0 commit comments

Comments
 (0)