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

package lastvalue

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


Package Files


type Aggregator Uses

type Aggregator struct {
    // contains filtered or unexported fields

Aggregator aggregates lastValue events.

func New Uses

func New(cnt int) []Aggregator

New returns a new lastValue aggregator. This aggregator retains the last value and timestamp that were recorded.

func (*Aggregator) Aggregation Uses

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

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

func (*Aggregator) Kind Uses

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

Kind returns aggregation.LastValueKind.

func (*Aggregator) LastValue Uses

func (g *Aggregator) LastValue() (number.Number, time.Time, error)

LastValue returns the last-recorded lastValue value and the corresponding timestamp. The error value aggregation.ErrNoData will be returned if (due to a race condition) the checkpoint was computed before the first value was set.

func (*Aggregator) Merge Uses

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

Merge combines state from two aggregators. The most-recently set value is chosen.

func (*Aggregator) SynchronizedMove Uses

func (g *Aggregator) SynchronizedMove(oa export.Aggregator, _ *metric.Descriptor) error

SynchronizedMove atomically saves the current value.

func (*Aggregator) Update Uses

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

Update atomically sets the current "last" value.

Package lastvalue imports 9 packages (graph) and is imported by 3 packages. Updated 2021-01-14. Refresh now. Tools for package owners.