Skip to content

Commit

Permalink
Merge pull request #25 from sei-protocol/v0.0.1-bweng
Browse files Browse the repository at this point in the history
execute contract metrics
  • Loading branch information
BrandonWeng authored May 19, 2023
2 parents c72e858 + ebbd9c9 commit 0e88845
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x/wasm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package keeper

import (
"context"
"time"

"github.com/armon/go-metrics"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

Expand Down Expand Up @@ -83,6 +85,11 @@ func (m msgServer) ExecuteContract(goCtx context.Context, msg *types.MsgExecuteC
if err != nil {
return nil, sdkerrors.Wrap(err, "contract")
}
defer metrics.MeasureSinceWithLabels(
[]string{"wasmd", "execute", "contract", "latency"},
time.Now(),
[]metrics.Label{{Name: "contract", Value: contractAddr.String()}},
)

ctx.EventManager().EmitEvent(sdk.NewEvent(
sdk.EventTypeMessage,
Expand Down

0 comments on commit 0e88845

Please sign in to comment.