package minmaxsumcount

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

Index

Types

type Aggregator

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

Aggregator aggregates events that form a distribution, keeping only the min, max, sum, and count.

func New

func New(cnt int, desc *metric.Descriptor) []Aggregator

New returns a new aggregator for computing the min, max, sum, and count. It does not compute quantile information other than Min and Max.

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() (int64, error)

Count returns the number of values in the checkpoint.

func (*Aggregator) Kind

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

Kind returns aggregation.MinMaxSumCountKind.

func (*Aggregator) Max

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

Max returns the maximum value in the checkpoint. The error value aggregation.ErrNoData will be returned if there were no measurements recorded during 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() (number.Number, error)

Min returns the minimum value in the checkpoint. The error value aggregation.ErrNoData will be returned if there were no measurements recorded during the checkpoint.

func (*Aggregator) Sum

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

Sum returns the sum of values in the checkpoint.

func (*Aggregator) SynchronizedMove

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

SynchronizedMove saves the current state into oa and resets the current state to the empty set.

func (*Aggregator) Update

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

Update adds the recorded measurement to the current data set.

Source Files

mmsc.go

Version
v0.14.0
Published
Nov 20, 2020
Platform
linux/amd64
Imports
7 packages
Last checked
24 minutes ago

Tools for package owners.