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

package sum

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


Package Files


type Aggregator Uses

type Aggregator struct {
    // contains filtered or unexported fields

Aggregator aggregates counter events.

func New Uses

func New(cnt int) []Aggregator

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

func (*Aggregator) Aggregation Uses

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

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

func (*Aggregator) Kind Uses

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

Kind returns aggregation.SumKind.

func (*Aggregator) Merge Uses

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

Merge combines two counters by adding their sums.

func (*Aggregator) Subtract Uses

func (c *Aggregator) Subtract(opAgg, resAgg export.Aggregator, descriptor *otel.Descriptor) error

func (*Aggregator) Sum Uses

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

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

func (*Aggregator) SynchronizedMove Uses

func (c *Aggregator) SynchronizedMove(oa export.Aggregator, _ *otel.Descriptor) error

SynchronizedMove atomically saves the current value into oa and resets the current sum to zero.

func (*Aggregator) Update Uses

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

Update atomically adds to the current value.

Package sum imports 5 packages (graph) and is imported by 3 packages. Updated 2020-10-17. Refresh now. Tools for package owners.