metrics

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NumberOfBlock         = stats.Int64("number_of_block", "Number of production blocks", stats.UnitDimensionless)
	NumberOfIsRoundWinner = stats.Int64("number_of_isroundwinner", "Number of is round winner", stats.UnitDimensionless)

	NumberOfMiningTimeout   = stats.Int64("number_of_mining_timeout", "Number of mining failures due to compute proof timeout", stats.UnitDimensionless)
	NumberOfMiningChainFork = stats.Int64("number_of_mining_chain_fork", "Number of mining failures due to chain fork", stats.UnitDimensionless)
	NumberOfMiningError     = stats.Int64("number_of_mining_error", "Number of mining failures due to error", stats.UnitDimensionless)
)
View Source
var (
	NumberOfBlockView = &view.View{
		Measure:     NumberOfBlock,
		Aggregation: view.Count(),
		TagKeys:     []tag.Key{MinerID},
	}
	IsRoundWinnerView = &view.View{
		Measure:     NumberOfIsRoundWinner,
		Aggregation: view.Count(),
		TagKeys:     []tag.Key{MinerID},
	}
	NumberOfMiningTimeoutView = &view.View{
		Measure:     NumberOfMiningTimeout,
		Aggregation: view.Count(),
		TagKeys:     []tag.Key{MinerID},
	}
	NumberOfMiningChainForkView = &view.View{
		Measure:     NumberOfMiningChainFork,
		Aggregation: view.Count(),
		TagKeys:     []tag.Key{MinerID},
	}
	NumberOfMiningErrorView = &view.View{
		Measure:     NumberOfMiningError,
		Aggregation: view.Count(),
		TagKeys:     []tag.Key{MinerID},
	}
)
View Source
var (
	MinerNumInState = metrics.NewInt64WithCategory("miner/num", "miner num in vary state", "")

	GetBaseInfoDuration      = metrics.NewTimerMs("mine/getbaseinfo", "Duration of GetBaseInfo in miner", MinerID)
	ComputeTicketDuration    = metrics.NewTimerMs("mine/computeticket", "Duration of ComputeTicket in miner", MinerID)
	CheckRoundWinnerDuration = metrics.NewTimerMs("mine/checkroundwinner", "Duration of Check Round Winner in miner", MinerID)
	ComputeProofDuration     = metrics.NewTimerMs("mine/computeproof", "Duration of ComputeProof in miner", MinerID)
)
View Source
var (
	MinerID, _ = tag.NewKey("miner_id")
)

Global Tags

Functions

func SetupMetrics

func SetupMetrics(ctx context.Context, metricsConfig *metrics.MetricsConfig) error

func SinceInMilliseconds

func SinceInMilliseconds(startTime time.Time) float64

func SinceInSeconds

func SinceInSeconds(startTime time.Time) float64

func TimerMilliseconds

func TimerMilliseconds(ctx context.Context, m *stats.Float64Measure, minerID string) func()

func TimerSeconds

func TimerSeconds(ctx context.Context, m *stats.Float64Measure, minerID string) func()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL