test

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unslice2 added in v0.7.0

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 added in v0.7.0

type NoopAggregator struct{}

NoopAggregator is useful for testing Exporters.

func (NoopAggregator) Aggregation added in v0.7.0

func (NoopAggregator) Aggregation() aggregation.Aggregation

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

func (NoopAggregator) Kind added in v0.7.0

Kind implements aggregation.Aggregation.

func (NoopAggregator) Merge added in v0.7.0

Merge implements export.Aggregator.

func (NoopAggregator) SynchronizedMove added in v0.7.0

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

SynchronizedMove implements export.Aggregator.

func (NoopAggregator) Update added in v0.7.0

Update implements export.Aggregator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL