metrics

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const Namespace = "op_challenger"

Variables

This section is empty.

Functions

This section is empty.

Types

type Metricer

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

	StartBalanceMetrics(l log.Logger, client *ethclient.Client, account common.Address) io.Closer

	// Record Tx metrics
	txmetrics.TxMetricer

	// Record cache metrics
	caching.Metrics

	// Record contract metrics
	contractMetrics.ContractMetricer

	// Record Vm metrics
	VmMetricer

	RecordActedL1Block(n uint64)

	RecordGameStep()
	RecordGameMove()
	RecordGameL2Challenge()
	RecordClaimResolutionTime(t float64)
	RecordGameActTime(t float64)

	RecordPreimageChallenged()
	RecordPreimageChallengeFailed()

	RecordBondClaimFailed()
	RecordBondClaimed(amount uint64)

	RecordGamesStatus(inProgress, defenderWon, challengerWon int)

	RecordGameUpdateScheduled()
	RecordGameUpdateCompleted()

	RecordLargePreimageCount(count int)

	IncActiveExecutors()
	DecActiveExecutors()
	IncIdleExecutors()
	DecIdleExecutors()

	ToTypedVmMetrics(vmType string) TypedVmMetricer
}
var NoopMetrics Metricer = new(NoopMetricsImpl)

type Metrics

type Metrics struct {
	txmetrics.TxMetrics
	*opmetrics.CacheMetrics
	*contractMetrics.ContractMetrics
	*VmMetrics
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) DecActiveExecutors added in v1.1.6

func (m *Metrics) DecActiveExecutors()

func (*Metrics) DecIdleExecutors added in v1.1.6

func (m *Metrics) DecIdleExecutors()

func (*Metrics) Document

func (m *Metrics) Document() []opmetrics.DocumentedMetric

func (*Metrics) IncActiveExecutors added in v1.1.6

func (m *Metrics) IncActiveExecutors()

func (*Metrics) IncIdleExecutors added in v1.1.6

func (m *Metrics) IncIdleExecutors()

func (*Metrics) RecordActedL1Block added in v1.4.3

func (m *Metrics) RecordActedL1Block(n uint64)

func (*Metrics) RecordBondClaimFailed added in v1.5.0

func (m *Metrics) RecordBondClaimFailed()

func (*Metrics) RecordBondClaimed added in v1.5.0

func (m *Metrics) RecordBondClaimed(amount uint64)

func (*Metrics) RecordClaimResolutionTime added in v1.7.3

func (m *Metrics) RecordClaimResolutionTime(t float64)

func (*Metrics) RecordGameActTime added in v1.7.3

func (m *Metrics) RecordGameActTime(t float64)

func (*Metrics) RecordGameL2Challenge added in v1.7.6

func (m *Metrics) RecordGameL2Challenge()

func (*Metrics) RecordGameMove added in v1.1.6

func (m *Metrics) RecordGameMove()

func (*Metrics) RecordGameStep added in v1.1.6

func (m *Metrics) RecordGameStep()

func (*Metrics) RecordGameUpdateCompleted added in v1.1.6

func (m *Metrics) RecordGameUpdateCompleted()

func (*Metrics) RecordGameUpdateScheduled added in v1.1.6

func (m *Metrics) RecordGameUpdateScheduled()

func (*Metrics) RecordGamesStatus added in v1.1.6

func (m *Metrics) RecordGamesStatus(inProgress, defenderWon, challengerWon int)

func (*Metrics) RecordInfo

func (m *Metrics) RecordInfo(version string)

RecordInfo sets a pseudo-metric that contains versioning and config info for the op-proposer.

func (*Metrics) RecordLargePreimageCount added in v1.8.0

func (m *Metrics) RecordLargePreimageCount(count int)

func (*Metrics) RecordPreimageChallengeFailed added in v1.5.1

func (m *Metrics) RecordPreimageChallengeFailed()

func (*Metrics) RecordPreimageChallenged added in v1.5.1

func (m *Metrics) RecordPreimageChallenged()

func (*Metrics) RecordUp

func (m *Metrics) RecordUp()

RecordUp sets the up metric to 1.

func (*Metrics) Registry added in v1.5.0

func (m *Metrics) Registry() *prometheus.Registry

func (*Metrics) Start added in v1.4.2

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

func (*Metrics) StartBalanceMetrics

func (m *Metrics) StartBalanceMetrics(
	l log.Logger,
	client *ethclient.Client,
	account common.Address,
) io.Closer

func (*Metrics) ToTypedVmMetrics added in v1.11.0

func (m *Metrics) ToTypedVmMetrics(vmType string) TypedVmMetricer

type NoopMetricsImpl added in v1.1.6

func (*NoopMetricsImpl) CacheAdd added in v1.4.2

func (*NoopMetricsImpl) CacheAdd(_ string, _ int, _ bool)

func (*NoopMetricsImpl) CacheGet added in v1.4.2

func (*NoopMetricsImpl) CacheGet(_ string, _ bool)

func (*NoopMetricsImpl) DecActiveExecutors added in v1.1.6

func (*NoopMetricsImpl) DecActiveExecutors()

func (*NoopMetricsImpl) DecIdleExecutors added in v1.1.6

func (*NoopMetricsImpl) DecIdleExecutors()

func (*NoopMetricsImpl) IncActiveExecutors added in v1.1.6

func (*NoopMetricsImpl) IncActiveExecutors()

func (*NoopMetricsImpl) IncIdleExecutors added in v1.1.6

func (*NoopMetricsImpl) IncIdleExecutors()

func (*NoopMetricsImpl) RecordActedL1Block added in v1.4.3

func (*NoopMetricsImpl) RecordActedL1Block(_ uint64)

func (*NoopMetricsImpl) RecordBondClaimFailed added in v1.5.0

func (*NoopMetricsImpl) RecordBondClaimFailed()

func (*NoopMetricsImpl) RecordBondClaimed added in v1.5.0

func (*NoopMetricsImpl) RecordBondClaimed(uint64)

func (*NoopMetricsImpl) RecordClaimResolutionTime added in v1.7.3

func (*NoopMetricsImpl) RecordClaimResolutionTime(t float64)

func (*NoopMetricsImpl) RecordGameActTime added in v1.7.3

func (*NoopMetricsImpl) RecordGameActTime(t float64)

func (*NoopMetricsImpl) RecordGameL2Challenge added in v1.7.6

func (*NoopMetricsImpl) RecordGameL2Challenge()

func (*NoopMetricsImpl) RecordGameMove added in v1.1.6

func (*NoopMetricsImpl) RecordGameMove()

func (*NoopMetricsImpl) RecordGameStep added in v1.1.6

func (*NoopMetricsImpl) RecordGameStep()

func (*NoopMetricsImpl) RecordGameUpdateCompleted added in v1.1.6

func (*NoopMetricsImpl) RecordGameUpdateCompleted()

func (*NoopMetricsImpl) RecordGameUpdateScheduled added in v1.1.6

func (*NoopMetricsImpl) RecordGameUpdateScheduled()

func (*NoopMetricsImpl) RecordGamesStatus added in v1.1.6

func (*NoopMetricsImpl) RecordGamesStatus(inProgress, defenderWon, challengerWon int)

func (*NoopMetricsImpl) RecordInfo added in v1.1.6

func (*NoopMetricsImpl) RecordInfo(version string)

func (*NoopMetricsImpl) RecordLargePreimageCount added in v1.8.0

func (*NoopMetricsImpl) RecordLargePreimageCount(_ int)

func (*NoopMetricsImpl) RecordPreimageChallengeFailed added in v1.5.1

func (*NoopMetricsImpl) RecordPreimageChallengeFailed()

func (*NoopMetricsImpl) RecordPreimageChallenged added in v1.5.1

func (*NoopMetricsImpl) RecordPreimageChallenged()

func (*NoopMetricsImpl) RecordUp added in v1.1.6

func (*NoopMetricsImpl) RecordUp()

func (*NoopMetricsImpl) StartBalanceMetrics added in v1.4.2

func (i *NoopMetricsImpl) StartBalanceMetrics(l log.Logger, client *ethclient.Client, account common.Address) io.Closer

func (*NoopMetricsImpl) ToTypedVmMetrics added in v1.11.0

func (m *NoopMetricsImpl) ToTypedVmMetrics(vmType string) TypedVmMetricer

type NoopVmMetrics added in v1.11.0

type NoopVmMetrics struct{}

func (NoopVmMetrics) RecordVmExecutionTime added in v1.11.0

func (n NoopVmMetrics) RecordVmExecutionTime(vmType string, t time.Duration)

func (NoopVmMetrics) RecordVmForcedPreemptionCount added in v1.11.0

func (n NoopVmMetrics) RecordVmForcedPreemptionCount(vmType string, val uint64)

func (NoopVmMetrics) RecordVmIdleStepCountThread0 added in v1.11.0

func (n NoopVmMetrics) RecordVmIdleStepCountThread0(vmType string, val uint64)

func (NoopVmMetrics) RecordVmMaxStepsBetweenLLAndSC added in v1.11.0

func (n NoopVmMetrics) RecordVmMaxStepsBetweenLLAndSC(vmType string, val uint64)

func (NoopVmMetrics) RecordVmMemoryUsed added in v1.11.0

func (n NoopVmMetrics) RecordVmMemoryUsed(vmType string, memoryUsed uint64)

func (NoopVmMetrics) RecordVmReservationInvalidationCount added in v1.11.0

func (n NoopVmMetrics) RecordVmReservationInvalidationCount(vmType string, val uint64)

func (NoopVmMetrics) RecordVmRmwFailCount added in v1.11.0

func (n NoopVmMetrics) RecordVmRmwFailCount(vmType string, val uint64)

func (NoopVmMetrics) RecordVmRmwSuccessCount added in v1.11.0

func (n NoopVmMetrics) RecordVmRmwSuccessCount(vmType string, val uint64)

func (NoopVmMetrics) RecordVmSteps added in v1.11.0

func (n NoopVmMetrics) RecordVmSteps(vmType string, val uint64)

type TypedVmMetricer added in v1.11.0

type TypedVmMetricer interface {
	RecordExecutionTime(t time.Duration)
	RecordMemoryUsed(memoryUsed uint64)
	RecordSteps(val uint64)
	RecordRmwSuccessCount(val uint64)
	RecordRmwFailCount(val uint64)
	RecordMaxStepsBetweenLLAndSC(val uint64)
	RecordReservationInvalidationCount(val uint64)
	RecordForcedPreemptionCount(val uint64)
	RecordIdleStepCountThread0(val uint64)
}

TypedVmMetricer matches VmMetricer except the vmType parameter is already baked in and not supplied to each method

func NewTypedVmMetrics added in v1.11.0

func NewTypedVmMetrics(m VmMetricer, vmType string) TypedVmMetricer

type VmMetricer added in v1.9.3

type VmMetricer interface {
	RecordVmExecutionTime(vmType string, t time.Duration)
	RecordVmMemoryUsed(vmType string, memoryUsed uint64)
	RecordVmRmwSuccessCount(vmType string, val uint64)
	RecordVmSteps(vmType string, val uint64)
	RecordVmRmwFailCount(vmType string, val uint64)
	RecordVmMaxStepsBetweenLLAndSC(vmType string, val uint64)
	RecordVmReservationInvalidationCount(vmType string, val uint64)
	RecordVmForcedPreemptionCount(vmType string, val uint64)
	RecordVmIdleStepCountThread0(vmType string, val uint64)
}

type VmMetrics added in v1.9.3

type VmMetrics struct {
	// contains filtered or unexported fields
}

func NewVmMetrics added in v1.9.3

func NewVmMetrics(namespace string, factory metrics.Factory) *VmMetrics

func (*VmMetrics) RecordVmExecutionTime added in v1.11.0

func (m *VmMetrics) RecordVmExecutionTime(vmType string, dur time.Duration)

func (*VmMetrics) RecordVmForcedPreemptionCount added in v1.11.0

func (m *VmMetrics) RecordVmForcedPreemptionCount(vmType string, val uint64)

func (*VmMetrics) RecordVmIdleStepCountThread0 added in v1.11.0

func (m *VmMetrics) RecordVmIdleStepCountThread0(vmType string, val uint64)

func (*VmMetrics) RecordVmMaxStepsBetweenLLAndSC added in v1.11.0

func (m *VmMetrics) RecordVmMaxStepsBetweenLLAndSC(vmType string, val uint64)

func (*VmMetrics) RecordVmMemoryUsed added in v1.11.0

func (m *VmMetrics) RecordVmMemoryUsed(vmType string, memoryUsed uint64)

func (*VmMetrics) RecordVmReservationInvalidationCount added in v1.11.0

func (m *VmMetrics) RecordVmReservationInvalidationCount(vmType string, val uint64)

func (*VmMetrics) RecordVmRmwFailCount added in v1.11.0

func (m *VmMetrics) RecordVmRmwFailCount(vmType string, val uint64)

func (*VmMetrics) RecordVmRmwSuccessCount added in v1.11.0

func (m *VmMetrics) RecordVmRmwSuccessCount(vmType string, val uint64)

func (*VmMetrics) RecordVmSteps added in v1.11.0

func (m *VmMetrics) RecordVmSteps(vmType string, val uint64)

Jump to

Keyboard shortcuts

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