measurer

package
v2.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Internal package with implementation of the measurer which is used for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discipline

type Discipline[Type any] interface {
	Output() <-chan types.Prioritized[Type]
	Release(priority uint)
	Err() <-chan error
}

type Measure

type Measure struct {
	Data         uint
	Kind         MeasureKind
	Priority     uint
	RelativeTime time.Duration
}

type MeasureKind

type MeasureKind int
const (
	MeasureKindCompleted MeasureKind = iota + 1
	MeasureKindProcessed
	MeasureKindReceived
)

type Measurer

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

func New

func New(opts Opts) *Measurer

func (*Measurer) AddDelay

func (msr *Measurer) AddDelay(priority uint, delay time.Duration)

func (*Measurer) AddWaitDevastation

func (msr *Measurer) AddWaitDevastation(priority uint)

func (*Measurer) AddWrite

func (msr *Measurer) AddWrite(priority uint, quantity uint)

func (*Measurer) AddWriteWithDelay

func (msr *Measurer) AddWriteWithDelay(priority uint, quantity uint, delay time.Duration)

func (*Measurer) GetExpectedItemsQuantity

func (msr *Measurer) GetExpectedItemsQuantity() uint

Number of data elements that must be sent to input channels.

func (*Measurer) GetExpectedMeasuresQuantity

func (msr *Measurer) GetExpectedMeasuresQuantity() uint

Number of measure elements to be obtained.

func (*Measurer) GetInputs

func (msr *Measurer) GetInputs() map[uint]<-chan uint

func (*Measurer) Play

func (msr *Measurer) Play(discipline Discipline[uint]) []Measure

func (*Measurer) SetProcessDelay

func (msr *Measurer) SetProcessDelay(priority uint, delay time.Duration)

type Opts

type Opts struct {
	DisableMeasures  bool
	HandlersQuantity uint
	InputCapacity    uint
	UnbufferedInput  bool
}

Jump to

Keyboard shortcuts

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