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

package histogram

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

Index

Package Files

histogram.go

type Aggregator Uses

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

Aggregator observe events and counts them in pre-determined buckets. It also calculates the sum and count of all events.

func New Uses

func New(cnt int, desc *otel.Descriptor, boundaries []float64) []Aggregator

New returns a new aggregator for computing Histograms.

A Histogram observe events and counts them in pre-defined buckets. And also provides the total sum and count of all observations.

Note that this aggregator maintains each value using independent atomic operations, which introduces the possibility that checkpoints are inconsistent.

func (*Aggregator) Aggregation Uses

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

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

func (*Aggregator) Count Uses

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

Count returns the number of values in the checkpoint.

func (*Aggregator) Histogram Uses

func (c *Aggregator) Histogram() (aggregation.Buckets, error)

Histogram returns the count of events in pre-determined buckets.

func (*Aggregator) Kind Uses

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

Kind returns aggregation.HistogramKind.

func (*Aggregator) Merge Uses

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

Merge combines two histograms that have the same buckets into a single one.

func (*Aggregator) Sum Uses

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

Sum returns the sum of all values in the checkpoint.

func (*Aggregator) SynchronizedMove Uses

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

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

func (*Aggregator) Update Uses

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

Update adds the recorded measurement to the current data set.

Package histogram imports 7 packages (graph) and is imported by 2 packages. Updated 2020-10-20. Refresh now. Tools for package owners.