From 69c1c4b978cc1f7d1e3d8eab2ac3cc3f8f16296d Mon Sep 17 00:00:00 2001 From: Jay Yu <103467857+jayy04@users.noreply.github.com> Date: Tue, 7 May 2024 11:03:57 -0400 Subject: [PATCH] add lag metrics --- protocol/app/app.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/app/app.go b/protocol/app/app.go index 990235763b9..0264bfe0ddf 100644 --- a/protocol/app/app.go +++ b/protocol/app/app.go @@ -46,6 +46,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" @@ -1493,6 +1494,8 @@ func (app *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { // EndBlocker application updates every end block func (app *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + defer telemetry.MeasureSince(ctx.BlockTime(), "end_blocker_lag") + ctx = ctx.WithExecMode(lib.ExecModeEndBlock) // Reset the logger for middleware.