fake

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package fake implements metrics that can be used in tests that are run with t.Parallel(). The metric results cannot be asserted as they are a no-op.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct{}

Counter is a no-op implementation of a counter for tests.

func (*Counter) Close

func (c *Counter) Close()

Close is a no-op implementation for tests.

func (*Counter) Init

func (c *Counter) Init(name, description, unit string, aggregation aggregation.Aggregation, tagKeys ...string) error

Init is a no-op implementation for tests.

func (*Counter) MaybeGetResult

func (c *Counter) MaybeGetResult() map[string]int64

MaybeGetResult is a no-op implementation for tests.

func (*Counter) Record

func (c *Counter) Record(_ context.Context, val int64, tagValues ...string) error

Record is a no-op implementation for tests.

type Latency

type Latency struct{}

Latency is a no-op implementation of a latency for tests.

func (*Latency) Close

func (l *Latency) Close()

Close is a no-op implementation for tests.

func (*Latency) Init

func (l *Latency) Init(name, description, unit string, buckets []float64, tagKeys ...string) error

Init is a no-op implementation for tests.

func (*Latency) MaybeGetResult

func (l *Latency) MaybeGetResult() map[string][]int

MaybeGetResult is a no-op implementation for tests.

func (*Latency) Record

func (l *Latency) Record(ctx context.Context, val float64, tagValues ...string) error

Record is a no-op implementation for tests.

Jump to

Keyboard shortcuts

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