forked from cerc-io/laconicd-deprecated
analytics(app): update telemetry to Ethermint modules (#1106)
* analytics(evm): replace telemetry gauges with counters and add gasUsed counter * analytics(feemarket): add telemetry gauges for base fee and block gas * analytics(feemarket): add telemetry gauges for gas_used per gas_limit * analytics(feemarket): remove refund telemetry * analytics(app): update CHANGELOG * remove unwanted change * address PR comments * update comment
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tharsis/ethermint/x/feemarket/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/telemetry"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
@@ -20,6 +21,10 @@ func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
|
||||
|
||||
k.SetBaseFee(ctx, baseFee)
|
||||
|
||||
defer func() {
|
||||
telemetry.SetGauge(float32(baseFee.Int64()), "feemarket", "base_fee")
|
||||
}()
|
||||
|
||||
// Store current base fee in event
|
||||
ctx.EventManager().EmitEvents(sdk.Events{
|
||||
sdk.NewEvent(
|
||||
@@ -42,6 +47,10 @@ func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) {
|
||||
|
||||
k.SetBlockGasUsed(ctx, gasUsed)
|
||||
|
||||
defer func() {
|
||||
telemetry.SetGauge(float32(gasUsed), "feemarket", "block_gas")
|
||||
}()
|
||||
|
||||
ctx.EventManager().EmitEvent(sdk.NewEvent(
|
||||
"block_gas",
|
||||
sdk.NewAttribute("height", fmt.Sprintf("%d", ctx.BlockHeight())),
|
||||
|
||||
Reference in New Issue
Block a user