test

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectScope

func CollectScope(t *testing.T, collectors []data.Collector, seq data.Sequence) []data.Instrument

func CollectScopeReuse

func CollectScopeReuse(t *testing.T, collectors []data.Collector, seq data.Sequence, output *data.Scope) []data.Instrument

func DescriptorDescUnit added in v1.13.0

func DescriptorDescUnit(name string, ik sdkinstrument.Kind, nk number.Kind, desc, unit string) sdkinstrument.Descriptor

func Instrument

func Instrument(desc sdkinstrument.Descriptor, points ...data.Point) data.Instrument

func Library

func Library(name string, opts ...metric.MeterOption) instrumentation.Library

func Metrics

func Metrics(res *resource.Resource, scopes ...data.Scope) data.Metrics

func OTelErrors

func OTelErrors() *[]error

func Point

func Point(start, end time.Time, agg aggregation.Aggregation, tempo aggregation.Temporality, kvs ...attribute.KeyValue) data.Point

func RequireEqualMetrics

func RequireEqualMetrics(
	t *testing.T,
	output []data.Instrument,
	expected ...data.Instrument)

RequireEqualMetrics checks that an output equals the expected output, where the points are taken to be unordered. Instrument order is expected to match because the compiler preserves the order of views and instruments as they are compiled.

func RequireEqualPoints

func RequireEqualPoints(t *testing.T, output []data.Point, expected ...data.Point)

func RequireEqualResourceMetrics

func RequireEqualResourceMetrics(t *testing.T, output data.Metrics, expectRes *resource.Resource, expectScopes ...data.Scope)

func Scope

func Scope(library instrumentation.Library, insts ...data.Instrument) data.Scope

Types

This section is empty.

Jump to

Keyboard shortcuts

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