File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,12 @@ impl EngineApiMetrics {
7979 let mut executor = executor. with_state_hook ( Some ( Box :: new ( wrapper) ) ) ;
8080
8181 let f = || {
82+ let start = Instant :: now ( ) ;
8283 debug_span ! ( target: "engine::tree" , "pre execution" )
8384 . entered ( )
8485 . in_scope ( || executor. apply_pre_execution_changes ( ) ) ?;
86+ self . executor . pre_execution_histogram . record ( start. elapsed ( ) ) ;
87+
8588 let exec_span = debug_span ! ( target: "engine::tree" , "execution" ) . entered ( ) ;
8689 loop {
8790 let start = Instant :: now ( ) ;
@@ -103,10 +106,15 @@ impl EngineApiMetrics {
103106 enter. record ( "gas_used" , gas_used) ;
104107 }
105108 drop ( exec_span) ;
106- debug_span ! ( target: "engine::tree" , "finish" )
109+
110+ let start = Instant :: now ( ) ;
111+ let result = debug_span ! ( target: "engine::tree" , "finish" )
107112 . entered ( )
108113 . in_scope ( || executor. finish ( ) )
109- . map ( |( evm, result) | ( evm. into_db ( ) , result) )
114+ . map ( |( evm, result) | ( evm. into_db ( ) , result) ) ;
115+ self . executor . post_execution_histogram . record ( start. elapsed ( ) ) ;
116+
117+ result
110118 } ;
111119
112120 // Use metered to execute and track timing/gas metrics
Original file line number Diff line number Diff line change @@ -17,11 +17,14 @@ pub struct ExecutorMetrics {
1717 /// The Histogram for amount of gas used.
1818 pub gas_used_histogram : Histogram ,
1919
20+ /// The Histogram for amount of time taken to execute the pre-execution changes.
21+ pub pre_execution_histogram : Histogram ,
2022 /// The Histogram for amount of time taken to wait for one transaction to be available.
2123 pub transaction_wait_histogram : Histogram ,
2224 /// The Histogram for amount of time taken to execute one transaction.
2325 pub transaction_execution_histogram : Histogram ,
24-
26+ /// The Histogram for amount of time taken to execute the post-execution changes.
27+ pub post_execution_histogram : Histogram ,
2528 /// The Histogram for amount of time taken to execute blocks.
2629 pub execution_histogram : Histogram ,
2730 /// The total amount of time it took to execute the latest block.
You can’t perform that action at this time.
0 commit comments