Skip to content

Commit

Permalink
measure since
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonWeng committed May 18, 2023
1 parent e6eeb8b commit ebbd9c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions x/wasm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"context"
"time"

"github.com/armon/go-metrics"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -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()}},
)

Expand Down

0 comments on commit ebbd9c9

Please sign in to comment.