Skip to content

Commit

Permalink
feat(baseapp): add per message telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
ziscky committed Oct 8, 2024
1 parent 5dc8768 commit d5d5a6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1030,9 +1030,10 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte, tx sdk.Tx) (gInfo sdk.G
func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, reflectMsgs []protoreflect.Message, mode execMode) (*sdk.Result, error) {
events := sdk.EmptyEvents()
msgResponses := make([]*codectypes.Any, 0, len(msgs))

// NOTE: GasWanted is determined by the AnteHandler and GasUsed by the GasMeter.
for i, msg := range msgs {
start := telemetry.Now()

if mode != execModeFinalize && mode != execModeSimulate {
break
}
Expand Down Expand Up @@ -1076,6 +1077,8 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, reflectMsgs []proto
}
msgResponses = append(msgResponses, msgResponse)
}

telemetry.MeasureSince(start, "tx", "msg", "processing_time", sdk.MsgTypeURL(msg))
}

data, err := makeABCIData(msgResponses)
Expand Down

0 comments on commit d5d5a6d

Please sign in to comment.