@@ -246,7 +246,6 @@ func (blockExec *BlockExecutor) ApplyBlock(
246
246
defer finalizeBlockSpan .End ()
247
247
}
248
248
txs := block .Data .Txs .ToSliceOfBytes ()
249
- finalizeBlockStartTime := time .Now ()
250
249
fBlockRes , err := blockExec .appClient .FinalizeBlock (
251
250
ctx ,
252
251
& abci.RequestFinalizeBlock {
@@ -270,7 +269,6 @@ func (blockExec *BlockExecutor) ApplyBlock(
270
269
LastResultsHash : block .LastResultsHash ,
271
270
},
272
271
)
273
- blockExec .metrics .FinalizeBlockLatency .Observe (float64 (time .Since (finalizeBlockStartTime ).Milliseconds ()))
274
272
if finalizeBlockSpan != nil {
275
273
finalizeBlockSpan .End ()
276
274
}
@@ -288,9 +286,7 @@ func (blockExec *BlockExecutor) ApplyBlock(
288
286
)
289
287
290
288
// Save the results before we commit.
291
- saveBlockResponseTime := time .Now ()
292
289
err = blockExec .store .SaveFinalizeBlockResponses (block .Height , fBlockRes )
293
- blockExec .metrics .SaveBlockResponseLatency .Observe (float64 (time .Since (saveBlockResponseTime ).Milliseconds ()))
294
290
if err != nil && ! errors .Is (err , ErrNoFinalizeBlockResponsesForHeight {block .Height }) {
295
291
// It is correct to have an empty ResponseFinalizeBlock for ApplyBlock,
296
292
// but not for saving it to the state store
@@ -344,14 +340,12 @@ func (blockExec *BlockExecutor) ApplyBlock(
344
340
blockExec .evpool .Update (ctx , state , block .Evidence )
345
341
346
342
// Update the app hash and save the state.
347
- saveBlockTime := time .Now ()
348
343
state .AppHash = fBlockRes .AppHash
349
344
if err := blockExec .store .Save (state ); err != nil {
350
345
return state , err
351
346
}
352
- blockExec . metrics . SaveBlockLatency . Observe ( float64 ( time . Since ( saveBlockTime ). Milliseconds ()))
347
+
353
348
// Prune old heights, if requested by ABCI app.
354
- pruneBlockTime := time .Now ()
355
349
if retainHeight > 0 {
356
350
pruned , err := blockExec .pruneBlocks (retainHeight )
357
351
if err != nil {
@@ -360,15 +354,14 @@ func (blockExec *BlockExecutor) ApplyBlock(
360
354
blockExec .logger .Debug ("pruned blocks" , "pruned" , pruned , "retain_height" , retainHeight )
361
355
}
362
356
}
363
- blockExec . metrics . PruneBlockLatency . Observe ( float64 ( time . Since ( pruneBlockTime ). Milliseconds ()))
357
+
364
358
// reset the verification cache
365
359
blockExec .cache = make (map [string ]struct {})
366
360
367
361
// Events are fired after everything else.
368
362
// NOTE: if we crash between Commit and Save, events wont be fired during replay
369
- fireEventsStartTime := time .Now ()
370
363
FireEvents (blockExec .logger , blockExec .eventBus , block , blockID , fBlockRes , validatorUpdates )
371
- blockExec . metrics . FireEventsLatency . Observe ( float64 ( time . Since ( fireEventsStartTime ). Milliseconds ()))
364
+
372
365
return state , nil
373
366
}
374
367
0 commit comments