mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 23:35:19 +00:00
9a0aed7626
* initialize x/metrics with metrics collection * include global labels in x/metrics metrics * add x/metrics spec * add x/metrics test coverage * update changelog
13 lines
301 B
Go
13 lines
301 B
Go
package metrics
|
|
|
|
import (
|
|
"github.com/kava-labs/kava/x/metrics/types"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
// BeginBlocker publishes metrics at the start of each block.
|
|
func BeginBlocker(ctx sdk.Context, metrics *types.Metrics) {
|
|
metrics.LatestBlockHeight.Set(float64(ctx.BlockHeight()))
|
|
}
|