metrics

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace         = "kroma_validator"
	L2OutputSubmitted = "submitted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metricer

type Metricer interface {
	RecordInfo(version string)
	RecordUp()

	// Records all L1 and L2 block events
	opmetrics.RefMetricer

	// Record Tx metrics
	txmetrics.TxMetricer

	RecordL2OutputSubmitted(l2ref eth.L2BlockRef)
	RecordDepositAmount(amount *big.Int)
	RecordNextValidator(address common.Address)
	RecordChallengeCheckpoint(outputIndex *big.Int)
}
var NoopMetrics Metricer = new(noopMetrics)

type Metrics

type Metrics struct {
	opmetrics.RefMetrics
	txmetrics.TxMetrics
	opmetrics.RPCMetrics

	Info                prometheus.GaugeVec
	Up                  prometheus.Gauge
	DepositAmount       prometheus.Gauge
	NextValidator       prometheus.GaugeVec
	ChallengeCheckpoint prometheus.Gauge
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(procName string) *Metrics

func (*Metrics) RecordChallengeCheckpoint

func (m *Metrics) RecordChallengeCheckpoint(outputIndex *big.Int)

RecordChallengeCheckpoint sets the output index that the challenge function last checked.

func (*Metrics) RecordDepositAmount

func (m *Metrics) RecordDepositAmount(amount *big.Int)

RecordDepositAmount sets the amount deposited into the ValidatorPool contract.

func (*Metrics) RecordInfo

func (m *Metrics) RecordInfo(version string)

RecordInfo sets a pseudo-metric that contains versioning and config info for the kroma-validator.

func (*Metrics) RecordL2OutputSubmitted

func (m *Metrics) RecordL2OutputSubmitted(l2ref eth.L2BlockRef)

RecordL2OutputSubmitted should be called when new L2 output is submitted

func (*Metrics) RecordNextValidator

func (m *Metrics) RecordNextValidator(address common.Address)

RecordNextValidator sets the address of the next validator.

func (*Metrics) RecordUp

func (m *Metrics) RecordUp()

RecordUp sets the up metric to 1.

func (*Metrics) Start added in v1.2.0

func (m *Metrics) Start(host string, port int) (*httputil.HTTPServer, error)

func (*Metrics) StartBalanceMetrics

func (m *Metrics) StartBalanceMetrics(ctx context.Context,
	l log.Logger, client *ethclient.Client, account common.Address)

Jump to

Keyboard shortcuts

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