monitor

package
v5.0.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package monitor defines a runtime service which receives notifications triggered by events related to performance of tracked validating keys. It then logs and emits metrics for a user to keep finely detailed performance measures.

Index

Constants

View Source
const AggregateReportingPeriod = 5

AggregateReportingPeriod defines the number of epochs between aggregate reports.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {

	// Locks access to TrackedValidators, latestPerformance, aggregatedPerformance,
	// trackedSyncedCommitteeIndices and lastSyncedEpoch
	sync.RWMutex

	TrackedValidators map[primitives.ValidatorIndex]bool
	// contains filtered or unexported fields
}

Service is the main structure that tracks validators and reports logs and metrics of their performances throughout their lifetime.

func NewService

func NewService(ctx context.Context, config *ValidatorMonitorConfig, tracked []primitives.ValidatorIndex) (*Service, error)

NewService sets up a new validator monitor service instance when given a list of validator indices to track.

func (*Service) Start

func (s *Service) Start()

Start sets up the TrackedValidators map and then calls to wait until the beacon is synced.

func (*Service) Status

func (s *Service) Status() error

Status retrieves the status of the service.

func (*Service) Stop

func (s *Service) Stop() error

Stop stops the service.

type ValidatorAggregatedPerformance

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

ValidatorAggregatedPerformance keeps track of the accumulated performance of the tracked validator since start of monitor service.

type ValidatorLatestPerformance

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

ValidatorLatestPerformance keeps track of the latest participation of the validator

type ValidatorMonitorConfig

type ValidatorMonitorConfig struct {
	StateNotifier       statefeed.Notifier
	AttestationNotifier operation.Notifier
	HeadFetcher         blockchain.HeadFetcher
	StateGen            stategen.StateManager
	InitialSyncComplete chan struct{}
}

ValidatorMonitorConfig contains the list of validator indices that the monitor service tracks, and the event feed notifier that the monitor needs to subscribe.

Jump to

Keyboard shortcuts

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