@@ -1161,6 +1161,7 @@ where
1161
1161
& mut self ,
1162
1162
event : Option < Result < BlockStreamEvent < C > , CancelableError < BlockStreamError > > > ,
1163
1163
) -> Result < Action , Error > {
1164
+ let stopwatch = & self . metrics . stream . stopwatch ;
1164
1165
let action = match event {
1165
1166
Some ( Ok ( BlockStreamEvent :: ProcessWasmBlock (
1166
1167
block_ptr,
@@ -1169,31 +1170,19 @@ where
1169
1170
handler,
1170
1171
cursor,
1171
1172
) ) ) => {
1172
- let _section = self
1173
- . metrics
1174
- . stream
1175
- . stopwatch
1176
- . start_section ( PROCESS_WASM_BLOCK_SECTION_NAME ) ;
1173
+ let _section = stopwatch. start_section ( PROCESS_WASM_BLOCK_SECTION_NAME ) ;
1177
1174
let res = self
1178
1175
. handle_process_wasm_block ( block_ptr. clone ( ) , block_time, data, handler, cursor)
1179
1176
. await ;
1180
1177
let start = Instant :: now ( ) ;
1181
1178
self . handle_action ( start, block_ptr, res) . await ?
1182
1179
}
1183
1180
Some ( Ok ( BlockStreamEvent :: ProcessBlock ( block, cursor) ) ) => {
1184
- let _section = self
1185
- . metrics
1186
- . stream
1187
- . stopwatch
1188
- . start_section ( PROCESS_BLOCK_SECTION_NAME ) ;
1181
+ let _section = stopwatch. start_section ( PROCESS_BLOCK_SECTION_NAME ) ;
1189
1182
self . handle_process_block ( block, cursor) . await ?
1190
1183
}
1191
1184
Some ( Ok ( BlockStreamEvent :: Revert ( revert_to_ptr, cursor) ) ) => {
1192
- let _section = self
1193
- . metrics
1194
- . stream
1195
- . stopwatch
1196
- . start_section ( HANDLE_REVERT_SECTION_NAME ) ;
1185
+ let _section = stopwatch. start_section ( HANDLE_REVERT_SECTION_NAME ) ;
1197
1186
self . handle_revert ( revert_to_ptr, cursor) . await ?
1198
1187
}
1199
1188
// Log and drop the errors from the block_stream
0 commit comments