package maxsumcount

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

Index

Types

type Aggregator

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

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

func New

func New() *Aggregator

New returns a new measure aggregator for computing 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

func (c *Aggregator) Checkpoint(ctx context.Context, _ *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 Max, Sum, and Count are not consistent with each other.

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 *export.Descriptor) error

Merge combines two data sets into one.

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 *export.Descriptor) error

Update adds the recorded measurement to the current data set.

Source Files

msc.go

Version
v0.1.1
Published
Nov 15, 2019
Platform
linux/amd64
Imports
4 packages
Last checked
12 minutes ago

Tools for package owners.