fakemetrics

package
v1.0.9620-b63dcd1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package fakemetrics provides an implementation of the o11y metrics provider that will record all metrics you send it.

If sending metrics is a particularly important part of a component's functionality then this package will help you test those metrics are sent.

Index

Constants

This section is empty.

Variables

View Source
var CMPMetrics = gocmp.Options{
	cmpopts.EquateApprox(0, 15),
	cmpopts.SortSlices(func(x, y MetricCall) bool {
		const format = "%s|%s|%s"
		return fmt.Sprintf(format, x.Metric, x.Name, x.Tags) <
			fmt.Sprintf(format, y.Metric, y.Name, y.Tags)
	}),
}

Functions

This section is empty.

Types

type MetricCall

type MetricCall struct {
	Metric   string
	Name     string
	Value    float64
	ValueInt int64
	Tags     []string
	Rate     float64
}

type Provider

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

func (*Provider) Calls

func (f *Provider) Calls() []MetricCall

func (*Provider) Close

func (f *Provider) Close() error

func (*Provider) Count

func (f *Provider) Count(name string, value int64, tags []string, rate float64) error

func (*Provider) Gauge

func (f *Provider) Gauge(name string, value float64, tags []string, rate float64) error

func (*Provider) Histogram

func (f *Provider) Histogram(name string, value float64, tags []string, rate float64) error

func (*Provider) Reset

func (f *Provider) Reset()

func (*Provider) TimeInMilliseconds

func (f *Provider) TimeInMilliseconds(name string, value float64, tags []string, rate float64) error

Jump to

Keyboard shortcuts

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