From ebbd9c944b0ced45f9cd5a8996c65fc2e7623e67 Mon Sep 17 00:00:00 2001 From: Brandon Weng <18161326+BrandonWeng@users.noreply.github.com> Date: Thu, 18 May 2023 19:13:28 -0400 Subject: [PATCH] measure since --- x/wasm/keeper/msg_server.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x/wasm/keeper/msg_server.go b/x/wasm/keeper/msg_server.go index ec816d6..a343504 100644 --- a/x/wasm/keeper/msg_server.go +++ b/x/wasm/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "time" "github.com/armon/go-metrics" sdk "github.com/cosmos/cosmos-sdk/types" @@ -84,9 +85,9 @@ func (m msgServer) ExecuteContract(goCtx context.Context, msg *types.MsgExecuteC if err != nil { return nil, sdkerrors.Wrap(err, "contract") } - metrics.IncrCounterWithLabels( - []string{"wasmd", "execute", "contract", "counter"}, - 1, + defer metrics.MeasureSinceWithLabels( + []string{"wasmd", "execute", "contract", "latency"}, + time.Now(), []metrics.Label{{Name: "contract", Value: contractAddr.String()}}, )