reorderer

package
v0.0.0-...-5bd602d Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package reorderer holds reorderer related files

Package reorderer holds reorderer related files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	TotalOp    uint64
	TotalDepth uint64
	QueueSize  uint64
}

Metric holds reordering metrics

type Monitor

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

Monitor represents a reorderer monitor

func NewReOrderMonitor

func NewReOrderMonitor(ctx context.Context, statsdClient statsd.ClientInterface, reOrderer *ReOrderer) (*Monitor, error)

NewReOrderMonitor instantiates a new reorder statistics counter

func (*Monitor) Start

func (r *Monitor) Start(wg *sync.WaitGroup)

Start the reorderer monitor

type Opts

type Opts struct {
	QueueSize       uint64        // size of the chan where the perf data are pushed
	Rate            time.Duration // delay between two time based iterations
	Retention       uint64        // bucket to keep before dequeueing
	MetricRate      time.Duration // delay between two metric samples
	HeapShrinkDelta int           // delta between cap and len between releasing heap array
}

Opts options to pass when creating a new instance of ReOrderer

type OrderedPerfMap

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

OrderedPerfMap implements the EventStream interface using an eBPF perf map associated with an event reorderer.

func NewOrderedPerfMap

func NewOrderedPerfMap(ctx context.Context, handler func(int, []byte), statsdClient statsd.ClientInterface) (*OrderedPerfMap, error)

NewOrderedPerfMap returned a new ordered perf map.

func (*OrderedPerfMap) Init

func (m *OrderedPerfMap) Init(mgr *manager.Manager, config *config.Config) error

Init the event stream.

func (*OrderedPerfMap) Pause

func (m *OrderedPerfMap) Pause() error

Pause the event stream.

func (*OrderedPerfMap) Resume

func (m *OrderedPerfMap) Resume() error

Resume the event stream.

func (*OrderedPerfMap) SetMonitor

func (m *OrderedPerfMap) SetMonitor(counter eventstream.LostEventCounter)

SetMonitor set the monitor

func (*OrderedPerfMap) Start

func (m *OrderedPerfMap) Start(wg *sync.WaitGroup) error

Start the event stream.

type QuickInfo

type QuickInfo struct {
	CPU       uint64
	Timestamp uint64
}

QuickInfo represents the info quickly extractable from an event, that can be used for reordering

func ExtractEventInfo

func ExtractEventInfo(record *perf.Record) (QuickInfo, error)

ExtractEventInfo extracts cpu and timestamp from the raw data event

type QuickInfoExtractor

type QuickInfoExtractor = func(record *perf.Record) (QuickInfo, error)

QuickInfoExtractor represents a function that takes a record, and returns the quick infos

type ReOrderer

type ReOrderer struct {
	Metrics chan Metric
	// contains filtered or unexported fields
}

ReOrderer defines an event re-orderer

func NewReOrderer

func NewReOrderer(ctx context.Context, handler func(record *perf.Record), extractInfo QuickInfoExtractor, opts Opts) *ReOrderer

NewReOrderer returns a new ReOrderer

func (*ReOrderer) HandleEvent

func (r *ReOrderer) HandleEvent(record *perf.Record, _ *manager.PerfMap, _ *manager.Manager)

HandleEvent handle event form perf ring

func (*ReOrderer) Start

func (r *ReOrderer) Start(wg *sync.WaitGroup)

Start event handler loop

Jump to

Keyboard shortcuts

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