testmetrics

package
v1.17.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RowSort

type RowSort []*view.Row

RowSort implements sort.Interface based on the string representation of Row.

func (RowSort) Len

func (rs RowSort) Len() int

func (RowSort) Less

func (rs RowSort) Less(i, j int) bool

func (RowSort) Swap

func (rs RowSort) Swap(i, j int)

type TestExporter

type TestExporter struct {
	// contains filtered or unexported fields
}

TestExporter keeps exported metric view data in memory to aid in testing.

func RegisterMetrics

func RegisterMetrics(views ...*view.View) *TestExporter

RegisterMetrics collects data for the given views and reports data to the TestExporter.

func (*TestExporter) ExportView

func (e *TestExporter) ExportView(data *view.Data)

ExportView records the view data.

func (*TestExporter) ValidateMetrics

func (e *TestExporter) ValidateMetrics(v *view.View, want []*view.Row) string

ValidateMetrics compares the exported view data with the expected metric data.

Jump to

Keyboard shortcuts

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