package test

import "go.opentelemetry.io/otel/exporters/metric/test"

Index

Functions

func Unslice2

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

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

Types

type CheckpointSet

type CheckpointSet struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

CheckpointSet is useful for testing Exporters.

func NewCheckpointSet

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

func (p *CheckpointSet) Add(desc *metric.Descriptor, newAgg export.Aggregator, labels ...kv.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

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

func (*CheckpointSet) Reset

func (p *CheckpointSet) Reset()

Reset clears the Aggregator state.

type NoopAggregator

type NoopAggregator struct{}

NoopAggregator is useful for testing Exporters.

func (NoopAggregator) Aggregation

func (NoopAggregator) Aggregation() aggregation.Aggregation

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

func (NoopAggregator) Kind

Kind implements aggregation.Aggregation.

func (NoopAggregator) Merge

Merge implements export.Aggregator.

func (NoopAggregator) SynchronizedMove

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

SynchronizedMove implements export.Aggregator.

func (NoopAggregator) Update

Update implements export.Aggregator.

Source Files

test.go

Version
v0.8.0
Published
Jul 10, 2020
Platform
darwin/amd64
Imports
11 packages
Last checked
33 minutes ago

Tools for package owners.