otel: go.opentelemetry.io/otel/sdk/export/metric/metrictest Index | Files

package metrictest

import "go.opentelemetry.io/otel/sdk/export/metric/metrictest"


Package Files


func Unslice2 Uses

func Unslice2(sl interface{}) (one, two export.Aggregator)

Takes a slice of []some.Aggregator and returns a slice of []export.Aggregator

type CheckpointSet Uses

type CheckpointSet struct {
    // contains filtered or unexported fields

CheckpointSet is useful for testing Exporters. TODO(#872): Uses of this can be replaced by processortest.Output.

func NewCheckpointSet Uses

func NewCheckpointSet(resource *resource.Resource) *CheckpointSet

NewCheckpointSet returns a test CheckpointSet that new records could be added. Records are grouped by their encoded labels.

func (*CheckpointSet) Add Uses

func (p *CheckpointSet) Add(desc *metric.Descriptor, newAgg export.Aggregator, labels ...label.KeyValue) (agg export.Aggregator, added bool)

Add a new record to a CheckpointSet.

If there is an existing record with the same descriptor and labels, the stored aggregator will be returned and should be merged.

func (*CheckpointSet) ForEach Uses

func (p *CheckpointSet) ForEach(_ export.ExportKindSelector, f func(export.Record) error) error

ForEach does not use ExportKindSelected: use a real Processor to test ExportKind functionality.

func (*CheckpointSet) Reset Uses

func (p *CheckpointSet) Reset()

Reset clears the Aggregator state.

type NoopAggregator Uses

type NoopAggregator struct{}

NoopAggregator is useful for testing Exporters.

func (NoopAggregator) Aggregation Uses

func (NoopAggregator) Aggregation() aggregation.Aggregation

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

func (NoopAggregator) Kind Uses

func (NoopAggregator) Kind() aggregation.Kind

Kind implements aggregation.Aggregation.

func (NoopAggregator) Merge Uses

func (NoopAggregator) Merge(export.Aggregator, *metric.Descriptor) error

Merge implements export.Aggregator.

func (NoopAggregator) SynchronizedMove Uses

func (NoopAggregator) SynchronizedMove(export.Aggregator, *metric.Descriptor) error

SynchronizedMove implements export.Aggregator.

func (NoopAggregator) Update Uses

func (NoopAggregator) Update(context.Context, number.Number, *metric.Descriptor) error

Update implements export.Aggregator.

Package metrictest imports 11 packages (graph). Updated 2020-11-13. Refresh now. Tools for package owners.