package array

import "go.opentelemetry.io/otel/sdk/metric/aggregator/array"

Index

Types

type Aggregator

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

func New

func New() *Aggregator

New returns a new array aggregator, which aggregates recorded measurements by storing them in an array. This type uses a mutex for Update() and Checkpoint() concurrency.

func (*Aggregator) Checkpoint

func (c *Aggregator) Checkpoint(ctx context.Context, desc *metric.Descriptor)

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

func (*Aggregator) Count

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

Count returns the number of values in the checkpoint.

func (*Aggregator) Max

func (c *Aggregator) Max() (core.Number, error)

Max returns the maximum value in the checkpoint.

func (*Aggregator) Merge

func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error

Merge combines two data sets into one.

func (*Aggregator) Min

func (c *Aggregator) Min() (core.Number, error)

Min returns the mininum value in the checkpoint.

func (*Aggregator) Points

func (c *Aggregator) Points() ([]core.Number, error)

Points returns access to the raw data set.

func (*Aggregator) Quantile

func (c *Aggregator) Quantile(q float64) (core.Number, error)

Quantile returns the estimated quantile of data in the checkpoint. It is an error if `q` is less than 0 or greated than 1.

func (*Aggregator) Sum

func (c *Aggregator) Sum() (core.Number, error)

Sum returns the sum of values in the checkpoint.

func (*Aggregator) Update

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

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

Source Files

array.go

Version
v0.4.3
Published
Apr 24, 2020
Platform
js/wasm
Imports
9 packages
Last checked
2 hours ago

Tools for package owners.