otel: go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount Index | Files

package minmaxsumcount

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

Index

Package Files

mmsc.go

type Aggregator Uses

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

Aggregator aggregates measure events, keeping only the max, sum, and count.

func New Uses

func New(desc *export.Descriptor) *Aggregator

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

Note that this aggregator maintains each value using independent atomic operations, which introduces the possibility that checkpoints are inconsistent. For greater consistency and lower performance, consider using Array or DDSketch aggregators.

func (*Aggregator) Checkpoint Uses

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

Checkpoint saves the current state and resets the current state to the empty set. Since no locks are taken, there is a chance that the independent Min, Max, Sum, and Count are not consistent with each other.

func (*Aggregator) Count Uses

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

Count returns the number of values in the checkpoint.

func (*Aggregator) Max Uses

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

Max returns the maximum value in the checkpoint. The error value aggregator.ErrEmptyDataSet will be returned if (due to a race condition) the checkpoint was set prior to current.max being computed in Update().

Note: If a measure's recorded values for a given checkpoint are all equal to NumberKind.Minimum(), Max() will return ErrEmptyDataSet

func (*Aggregator) Merge Uses

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

Merge combines two data sets into one.

func (*Aggregator) Min Uses

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

Min returns the minimum value in the checkpoint. The error value aggregator.ErrEmptyDataSet will be returned if (due to a race condition) the checkpoint was set prior to current.min being computed in Update().

Note: If a measure's recorded values for a given checkpoint are all equal to NumberKind.Maximum(), Min() will return ErrEmptyDataSet

func (*Aggregator) Sum Uses

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

Sum returns the sum of values in the checkpoint.

func (*Aggregator) Update Uses

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

Update adds the recorded measurement to the current data set.

Package minmaxsumcount imports 4 packages (graph) and is imported by 1 packages. Updated 2020-02-13. Refresh now. Tools for package owners.