exact

package
v1.2.115 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

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

Aggregator aggregates events that form a distribution, keeping an array with the exact set of values.

func New

func New(cnt int) []Aggregator

New returns cnt many new exact aggregators, which aggregate recorded measurements by storing them in an array. This type uses a mutex for Update() and SynchronizedMove() concurrency.

func (*Aggregator) Aggregation

func (c *Aggregator) Aggregation() aggregation.Aggregation

Aggregation returns an interface for reading the state of this aggregator.

func (*Aggregator) Count

func (c *Aggregator) Count() (uint64, error)

Count returns the number of values in the checkpoint.

func (*Aggregator) Kind

func (c *Aggregator) Kind() aggregation.Kind

Kind returns aggregation.ExactKind.

func (*Aggregator) Merge

func (c *Aggregator) Merge(oa aggregator.Aggregator, desc *sdkapi.Descriptor) error

Merge combines two data sets into one.

func (*Aggregator) Points

func (c *Aggregator) Points() ([]Point, error)

Points returns access to the raw data set.

func (*Aggregator) SynchronizedMove

func (c *Aggregator) SynchronizedMove(oa aggregator.Aggregator, desc *sdkapi.Descriptor) error

SynchronizedMove saves the current state to oa and resets the current state to the empty set, taking a lock to prevent concurrent Update() calls.

func (*Aggregator) Update

func (c *Aggregator) Update(_ context.Context, number number.Number, desc *sdkapi.Descriptor) error

Update adds the recorded measurement to the current data set. Update takes a lock to prevent concurrent Update() and SynchronizedMove() calls.

type Point

type Point struct {
	number.Number
	time.Time
}

Point is a raw data point, consisting of a number and value.

type Points

type Points interface {
	aggregation.Aggregation

	// Points returns points in the order they were
	// recorded.  Points are approximately ordered by
	// timestamp, but this is not guaranteed.
	Points() ([]Point, error)
}

Points returns the raw values that were aggregated.

Jump to

Keyboard shortcuts

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