Skip to content

Commit c228e18

Browse files
authored
fix(l1,l2): inaccurate block execution metrics (#5108)
**Motivation** Disaggregated block execution metrics are off because they count accumulate rather than each process' times. Given we treat them as parts of a single thing, e.g. later making a pie chart of them, they should be counted as difference from the end of the previous step, like we do in logs. **Description** Fix the subtractions.
1 parent ee97e8e commit c228e18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/blockchain/blockchain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ impl Blockchain {
581581
METRICS_BLOCKS.set_latest_block_gas_limit(gas_limit as f64);
582582
METRICS_BLOCKS.set_latest_gigagas(throughput);
583583
METRICS_BLOCKS.set_execution_ms(executed.duration_since(since).as_millis() as i64);
584-
METRICS_BLOCKS.set_store_ms(stored.duration_since(since).as_millis() as i64);
585-
METRICS_BLOCKS.set_merkle_ms(merkleized.duration_since(since).as_millis() as i64);
584+
METRICS_BLOCKS.set_merkle_ms(merkleized.duration_since(executed).as_millis() as i64);
585+
METRICS_BLOCKS.set_store_ms(stored.duration_since(merkleized).as_millis() as i64);
586586
METRICS_BLOCKS.set_transaction_count(transactions_count as i64);
587587
);
588588

0 commit comments

Comments
 (0)