Documentation
¶
Index ¶
- Constants
- type BaseEvent
- type BeaconDataProvider
- type DuplicateCache
- type Event
- type Metrics
- type Summary
- func (s *Summary) AddEventStreamEvents(topic string, count uint64)
- func (s *Summary) AddEventsExported(count uint64)
- func (s *Summary) AddFailedEvents(count uint64)
- func (s *Summary) GetEventStreamEvents() map[string]uint64
- func (s *Summary) GetEventsExported() uint64
- func (s *Summary) GetFailedEvents() uint64
- func (s *Summary) Print()
- func (s *Summary) Reset()
- func (s *Summary) Start(ctx context.Context)
Constants ¶
const ( // best to keep this > 1 epoch as some clients may send the same attestation on new epoch. TTL = 7 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseEvent ¶
type BaseEvent struct {
// contains filtered or unexported fields
}
BaseEvent provides common functionality for all events.
func NewBaseEvent ¶
type BeaconDataProvider ¶
type BeaconDataProvider interface { // GetWallclock returns the wallclock for the beacon chain. GetWallclock() *ethwallclock.EthereumBeaconChain // GetSlot returns the wallclock slot for a given slot number. GetSlot(slot uint64) ethwallclock.Slot // GetEpoch returns the wallclock epoch for a given epoch number. GetEpoch(epoch uint64) ethwallclock.Epoch // GetEpochFromSlot returns the wallclock epoch for a given slot number. GetEpochFromSlot(slot uint64) ethwallclock.Epoch // Synced returns true if the beacon node is synced. Synced(ctx context.Context) error // Node returns the underlying beacon node instance. Node() beacon.Node }
BeaconDataProvider defines the interface for getting beacon chain data needed by events.
type DuplicateCache ¶
type DuplicateCache struct { BeaconETHV1EventsBlock *ttlcache.Cache[string, time.Time] BeaconETHV1EventsChainReorg *ttlcache.Cache[string, time.Time] BeaconETHV1EventsFinalizedCheckpoint *ttlcache.Cache[string, time.Time] BeaconETHV1EventsHead *ttlcache.Cache[string, time.Time] BeaconETHV1EventsBlobSidecar *ttlcache.Cache[string, time.Time] }
func NewDuplicateCache ¶
func NewDuplicateCache() *DuplicateCache
func (*DuplicateCache) Start ¶
func (d *DuplicateCache) Start()
type Event ¶
type Event interface { // Meta returns the metadata of the event. Meta() *xatu.Meta // Type returns the type of the event. Type() string // Time returns the time of the event. Time() time.Time // Data returns the data of the event. Data() interface{} // Decorated returns the decorated event. Decorated() *xatu.DecoratedEvent // Ignore returns true if the event should be ignored. Ignore(ctx context.Context) (bool, error) }
Event is the interface that all events must implement.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics is the metrics for the events package.
func NewMetrics ¶
NewMetrics creates a new Metrics instance.
func (*Metrics) AddDecoratedEvent ¶
AddDecoratedEvent adds a decorated event to the metrics.
type Summary ¶
type Summary struct {
// contains filtered or unexported fields
}
Summary is a struct that holds the summary of the sentry.
func NewSummary ¶
func NewSummary(log logrus.FieldLogger, printInterval time.Duration) *Summary
NewSummary creates a new summary with the given print interval.
func (*Summary) AddEventStreamEvents ¶
AddEventStreamEvents adds the given count to the event stream topic.
func (*Summary) AddEventsExported ¶
AddEventsExported adds the given count to the events exported.
func (*Summary) AddFailedEvents ¶
AddFailedEvents adds the given count to the failed events.
func (*Summary) GetEventStreamEvents ¶
GetEventStreamEvents returns the event stream topics and counts.
func (*Summary) GetEventsExported ¶
GetEventsExported returns the number of events exported.
func (*Summary) GetFailedEvents ¶
GetFailedEvents returns the number of failed events.