instrumented

package
v0.0.0-...-ee0e00b Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSinkSession

func NewSinkSession[I core.BlockId, F core.Flags](
	store core.BlockStore[I],
	statusAccumulator core.StatusAccumulator[I],
	orchestrator core.Orchestrator[F],
	stats stats.Stats,
	options InstrumentationOptions,
	maxBlocksPerRound uint32,
	requester bool,
) *core.SinkSession[I, F]

func NewSourceSession

func NewSourceSession[I core.BlockId, F core.Flags](store core.BlockStore[I], filter filter.Filter[I], orchestrator core.Orchestrator[F], stats stats.Stats, options InstrumentationOptions, maxBlocksPerRound uint32, maxBlocksPerColdCall uint32, requester bool) *core.SourceSession[I, F]

func NewStatusReceiver

func NewStatusReceiver[I core.BlockId, F core.Flags](statusReceiver core.StatusReceiver[I], stats stats.Stats) core.StatusReceiver[I]

NewStatusReceiver returns a new StatusReceiver instance.

Types

type BlockSender

type BlockSender[I core.BlockId] struct {
	// contains filtered or unexported fields
}

BlockSender is a BlockSender that records stats for events.

func NewBlockSender

func NewBlockSender[I core.BlockId](blockSender core.BlockSender[I], stats stats.Stats) *BlockSender[I]

NewBlockSender returns a new BlockSender instance.

func (*BlockSender[I]) Close

func (ibs *BlockSender[I]) Close() error

Close calls the underlying block sender's Close method and records stats.

func (*BlockSender[I]) Flush

func (ibs *BlockSender[I]) Flush() error

Flush calls the underlying block sender's Flush method and records stats.

func (*BlockSender[I]) Len

func (ibs *BlockSender[I]) Len() int

Len calls the underlying block sender's Len method and records stats.

func (*BlockSender[I]) SendBlock

func (ibs *BlockSender[I]) SendBlock(block core.RawBlock[I]) error

SendBlock calls the underlying block sender's SendBlock method and records stats.

type BlockStore

type BlockStore[I core.BlockId] struct {
	// contains filtered or unexported fields
}

BlockStore is a BlockStore that records stats for events.

func NewBlockStore

func NewBlockStore[I core.BlockId](store core.BlockStore[I], stats stats.Stats) *BlockStore[I]

NewBlockStore returns a new BlockStore instance.

func (*BlockStore[I]) Add

func (ibs *BlockStore[I]) Add(ctx context.Context, rawBlock core.RawBlock[I]) (core.Block[I], error)

Add calls the underlying block store's Add method and records stats.

func (*BlockStore[I]) AddMany

func (ibs *BlockStore[I]) AddMany(ctx context.Context, rawBlocks []core.RawBlock[I]) ([]core.Block[I], error)

func (*BlockStore[I]) All

func (ibs *BlockStore[I]) All(ctx context.Context) (<-chan I, error)

All calls the underlying block store's All method and records stats.

func (*BlockStore[I]) Get

func (ibs *BlockStore[I]) Get(ctx context.Context, id I) (core.Block[I], error)

Get calls the underlying block store's Get method and records stats.

func (*BlockStore[I]) Has

func (ibs *BlockStore[I]) Has(ctx context.Context, id I) (bool, error)

Has calls the underlying block store's Has method and records stats.

type InstrumentationOptions

type InstrumentationOptions uint8
const (
	INSTRUMENT_STORE InstrumentationOptions = 1 << iota
	INSTRUMENT_ORCHESTRATOR
	INSTRUMENT_FILTER
	INSTRUMENT_SENDER
)

type Orchestrator

type Orchestrator[F core.Flags] struct {
	// contains filtered or unexported fields
}

Orchestrator is an Orchestrator that records stats for events.

func NewOrchestrator

func NewOrchestrator[F core.Flags](orchestrator core.Orchestrator[F], stats stats.Stats) *Orchestrator[F]

NewOrchestrator returns a new Orchestrator instance.

func (*Orchestrator[F]) IsClosed

func (io *Orchestrator[F]) IsClosed() bool

IsClosed calls the underlying orchestrator's IsClosed method and records stats.

func (*Orchestrator[F]) IsRequester

func (io *Orchestrator[F]) IsRequester() bool

IsRequester calls the underlying orchestrator's IsRequester method and records stats.

func (*Orchestrator[F]) IsSafeStateToClose

func (io *Orchestrator[F]) IsSafeStateToClose() bool

func (*Orchestrator[F]) Notify

func (io *Orchestrator[F]) Notify(event core.SessionEvent) error

Notify calls the underlying orchestrator's Notify method and records stats.

func (*Orchestrator[F]) ShouldFlush

func (io *Orchestrator[F]) ShouldFlush() bool

func (*Orchestrator[F]) State

func (io *Orchestrator[F]) State() F

State calls the underlying orchestrator's State method and records stats.

type StatusReceiver

type StatusReceiver[I core.BlockId] struct {
	// contains filtered or unexported fields
}

StatusReceiver is a StatusReceiver that records stats for events.

func (*StatusReceiver[I]) HandleStatus

func (ir *StatusReceiver[I]) HandleStatus(have filter.Filter[I], want []I)

HandleStatus calls the underlying status receiver's HandleStatus method and records stats.

type StatusSender

type StatusSender[I core.BlockId] struct {
	// contains filtered or unexported fields
}

StatusSender is a StatusSender that records stats for events.

func NewStatusSender

func NewStatusSender[I core.BlockId](statusSender core.StatusSender[I], stats stats.Stats) *StatusSender[I]

NewStatusSender returns a new StatusSender instance.

func (*StatusSender[I]) Close

func (ibs *StatusSender[I]) Close() error

Close calls the underlying status sender's Close method and records stats.

func (*StatusSender[I]) SendStatus

func (ibs *StatusSender[I]) SendStatus(have filter.Filter[I], want []I) error

SendStatus calls the underlying status sender's SendStatus method and records stats.

Jump to

Keyboard shortcuts

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