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

package counter

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

Index

Package Files

counter.go

type Aggregator Uses

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

Aggregator aggregates counter events.

func New Uses

func New() *Aggregator

New returns a new counter aggregator implemented by atomic operations. This aggregator implements the aggregator.Sum export interface.

func (*Aggregator) Checkpoint Uses

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

Checkpoint atomically saves the current value and resets the current sum to zero.

func (*Aggregator) Merge Uses

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

Merge combines two counters by adding their sums.

func (*Aggregator) Sum Uses

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

Sum returns the last-checkpointed sum. This will never return an error.

func (*Aggregator) Update Uses

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

Update atomically adds to the current value.

Package counter imports 4 packages (graph) and is imported by 3 packages. Updated 2020-01-06. Refresh now. Tools for package owners.