Help us shape the future of Go! Take the 2026 Go Developer Survey

testmetrics

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 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