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 ¶
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.
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.