monitortest

package
v0.0.0-...-48947c8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlmostEquals

func AlmostEquals(v float64, eps float64) func(any) error

Check if two floats are equal with some room for errors (for example, rounding errors) For rounding errors, setting `eps` to 1e-7 is a good default

func AtLeast

func AtLeast(want float64) func(any) error

func Buckets

func Buckets(count int) func(any) error

Buckets asserts a distribution has the number of buckets

func Distribution

func Distribution(count uint64, sum float64) func(any) error

func DoesNotExist

func DoesNotExist(any) error

func Exactly

func Exactly(v float64) func(any) error

func LessThan

func LessThan(v float64) func(any) error

func TestRegistry

func TestRegistry(t test.Failer) prometheus.Gatherer

Types

type Compare

type Compare func(any) error

type Metric

type Metric struct {
	Name   string
	Labels map[string]string
	Value  string
}

type MetricsTest

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

func New

func New(t test.Failer) *MetricsTest

func (*MetricsTest) Assert

func (m *MetricsTest) Assert(name string, tags map[string]string, compare Compare, opts ...retry.Option)

func (*MetricsTest) Dump

func (m *MetricsTest) Dump()

func (*MetricsTest) Metrics

func (m *MetricsTest) Metrics() []Metric

Metrics returns the full list of known metrics. Usually Assert should be used

Jump to

Keyboard shortcuts

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