tester

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tester

type Tester struct {
	sdkmetric.Reader
	*testing.T
}

Tester provides testing utilities for OpenTelemetry metrics

func New

func New(reader sdkmetric.Reader, t *testing.T) *Tester

New creates a new test helper and returns both the helper and a MeterProvider that can be used to initialize the system under test

func (*Tester) CollectAndCount

func (h *Tester) CollectAndCount(name string) int

CollectAndCount returns the number of metrics with the given name and attributes

func (*Tester) CollectAndDump

func (h *Tester) CollectAndDump(name string, attrs ...string) string

CollectAndDump returns the metrics with the given name and attributes as a string.

func (*Tester) CollectAndGetInt

func (h *Tester) CollectAndGetInt(name string, attrs ...string) int

CollectAndGetInt returns the value of the metric with given name and attributes.

Jump to

Keyboard shortcuts

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