package metricdatatest

import "go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest"

Package metricdatatest provides testing functionality for use with the metricdata package.

Index

Functions

func AssertAggregationsEqual

func AssertAggregationsEqual(t *testing.T, expected, actual metricdata.Aggregation, opts ...Option) bool

AssertAggregationsEqual asserts that two Aggregations are equal.

func AssertEqual

func AssertEqual[T Datatypes](t *testing.T, expected, actual T, opts ...Option) bool

AssertEqual asserts that the two concrete data-types from the metricdata package are equal.

func AssertHasAttributes

func AssertHasAttributes[T Datatypes](t *testing.T, actual T, attrs ...attribute.KeyValue) bool

AssertHasAttributes asserts that all Datapoints or HistogramDataPoints have all passed attrs.

Types

type Datatypes

Datatypes are the concrete data-types the metricdata package provides.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option allows for fine grain control over how AssertEqual operates.

func IgnoreExemplars

func IgnoreExemplars() Option

IgnoreExemplars disables checking if Exemplars are different.

func IgnoreTimestamp

func IgnoreTimestamp() Option

IgnoreTimestamp disables checking if timestamps are different.

Source Files

assertion.go comparisons.go

Version
v0.39.0
Published
May 22, 2023
Platform
linux/amd64
Imports
6 packages
Last checked
14 minutes ago

Tools for package owners.