Documentation
¶
Index ¶
- func GetClientTypeID(clientName string) uint8
- func GetClientTypeName(clientTypeID uint8) string
- type BeaconExecutionTime
- type BlockHashRingBuffer
- type ExecutionTimeCache
- func (c *ExecutionTimeCache) Close()
- func (c *ExecutionTimeCache) Delete(blockHash common.Hash)
- func (c *ExecutionTimeCache) Get(blockHash common.Hash) []BeaconExecutionTime
- func (c *ExecutionTimeCache) GetAndDelete(blockHash common.Hash) []BeaconExecutionTime
- func (c *ExecutionTimeCache) GetStats() (int, int)
- func (c *ExecutionTimeCache) Set(blockHash common.Hash, client *execution.Client, execTime time.Duration)
- type ExecutionTimeEvent
- type ExecutionTimeProviderImpl
- type SnooperManager
- func (sm *SnooperManager) AddClient(executionClient *execution.Client, snooperURL string) error
- func (sm *SnooperManager) Close() error
- func (sm *SnooperManager) GetCache() *ExecutionTimeCache
- func (sm *SnooperManager) HandleExecutionTimeEvent(event *ExecutionTimeEvent)
- func (sm *SnooperManager) HasClients() bool
- func (sm *SnooperManager) RemoveClient(clientID uint16)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientTypeID ¶
GetClientTypeID maps client names to type IDs
func GetClientTypeName ¶
GetClientTypeName maps client type IDs to names
Types ¶
type BeaconExecutionTime ¶
type BeaconExecutionTime struct {
Client *execution.Client // snooper client
Time uint16 // milliseconds
Added time.Time // when this was recorded
}
BeaconExecutionTime represents execution timing data compatible with beacon package
func (*BeaconExecutionTime) GetClient ¶
func (e *BeaconExecutionTime) GetClient() *execution.Client
Implement ExecutionTimeData interface
func (*BeaconExecutionTime) GetTime ¶
func (e *BeaconExecutionTime) GetTime() uint16
type BlockHashRingBuffer ¶
type BlockHashRingBuffer struct {
// contains filtered or unexported fields
}
BlockHashRingBuffer implements an efficient ring buffer for storing block hashes
func NewBlockHashRingBuffer ¶
func NewBlockHashRingBuffer(capacity int) *BlockHashRingBuffer
NewBlockHashRingBuffer creates a new ring buffer with the specified capacity
func (*BlockHashRingBuffer) Add ¶
func (rb *BlockHashRingBuffer) Add(hash common.Hash)
Add adds a block hash to the ring buffer
func (*BlockHashRingBuffer) Clear ¶
func (rb *BlockHashRingBuffer) Clear()
Clear removes all elements from the buffer
func (*BlockHashRingBuffer) Contains ¶
func (rb *BlockHashRingBuffer) Contains(hash common.Hash) bool
Contains checks if a block hash exists in the ring buffer
func (*BlockHashRingBuffer) Size ¶
func (rb *BlockHashRingBuffer) Size() int
Size returns the current number of elements in the buffer
type ExecutionTimeCache ¶
type ExecutionTimeCache struct {
// contains filtered or unexported fields
}
ExecutionTimeCache temporarily stores execution times for blocks that haven't been processed yet
func NewExecutionTimeCache ¶
func NewExecutionTimeCache(ttl time.Duration) *ExecutionTimeCache
NewExecutionTimeCache creates a new execution time cache
func (*ExecutionTimeCache) Close ¶
func (c *ExecutionTimeCache) Close()
Close stops the cache cleanup routine
func (*ExecutionTimeCache) Delete ¶
func (c *ExecutionTimeCache) Delete(blockHash common.Hash)
Delete removes execution times for a specific block hash
func (*ExecutionTimeCache) Get ¶
func (c *ExecutionTimeCache) Get(blockHash common.Hash) []BeaconExecutionTime
Get retrieves execution times for a specific block hash
func (*ExecutionTimeCache) GetAndDelete ¶
func (c *ExecutionTimeCache) GetAndDelete(blockHash common.Hash) []BeaconExecutionTime
GetAndDelete atomically retrieves and removes execution times for a specific block hash
func (*ExecutionTimeCache) GetStats ¶
func (c *ExecutionTimeCache) GetStats() (int, int)
GetStats returns cache statistics
type ExecutionTimeEvent ¶
type ExecutionTimeEvent struct {
BlockHash common.Hash
BlockNumber uint64
ClientID uint16
ExecutionTime time.Duration
Timestamp time.Time
}
ExecutionTimeEvent represents a block execution time event
type ExecutionTimeProviderImpl ¶
type ExecutionTimeProviderImpl struct {
// contains filtered or unexported fields
}
ExecutionTimeProviderImpl implements the ExecutionTimeProvider interface
func NewExecutionTimeProvider ¶
func NewExecutionTimeProvider(cache *ExecutionTimeCache) *ExecutionTimeProviderImpl
NewExecutionTimeProvider creates a new execution time provider
func (*ExecutionTimeProviderImpl) GetAndDeleteExecutionTimes ¶
func (p *ExecutionTimeProviderImpl) GetAndDeleteExecutionTimes(blockHash common.Hash) []beacon.ExecutionTimeData
GetAndDeleteExecutionTimes implements the ExecutionTimeProvider interface
type SnooperManager ¶
type SnooperManager struct {
// contains filtered or unexported fields
}
SnooperManager manages snooper clients for execution time tracking
func NewSnooperManager ¶
func NewSnooperManager(logger logrus.FieldLogger, indexer *beacon.Indexer) *SnooperManager
NewSnooperManager creates a new snooper manager
func (*SnooperManager) AddClient ¶
func (sm *SnooperManager) AddClient(executionClient *execution.Client, snooperURL string) error
AddClient adds a new snooper client for an execution client
func (*SnooperManager) Close ¶
func (sm *SnooperManager) Close() error
Close gracefully shuts down the snooper manager
func (*SnooperManager) GetCache ¶
func (sm *SnooperManager) GetCache() *ExecutionTimeCache
GetCache returns the execution time cache
func (*SnooperManager) HandleExecutionTimeEvent ¶
func (sm *SnooperManager) HandleExecutionTimeEvent(event *ExecutionTimeEvent)
HandleExecutionTimeEvent processes execution time events from tracer_event messages
func (*SnooperManager) HasClients ¶
func (sm *SnooperManager) HasClients() bool
HasClients returns true if any snooper clients are configured
func (*SnooperManager) RemoveClient ¶
func (sm *SnooperManager) RemoveClient(clientID uint16)
RemoveClient removes a snooper client