testingutil

package
v0.0.0-...-8b49249 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package testingutil provides utility functions used only in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMetrics

func CheckMetrics(t *testing.T, metrics *FakeMonitoringClient, expected map[string]int64)

CheckMetrics checks whether metrics match expected.

Types

type FakeMonitoringClient

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

FakeMonitoringClient is a client used for local testing. Not thread-safe.

func NewFakeMonitoringClient

func NewFakeMonitoringClient() *FakeMonitoringClient

NewFakeMonitoringClient creates a new FakeMonitoringClient.

func (*FakeMonitoringClient) AddLatency

func (c *FakeMonitoringClient) AddLatency(name string, value float64)

AddLatency adds a latency value to a latency metric.

func (*FakeMonitoringClient) CounterValue

func (c *FakeMonitoringClient) CounterValue(name string) int64

CounterValue returns the value of a counter metric.

func (*FakeMonitoringClient) IncCounter

func (c *FakeMonitoringClient) IncCounter(name string)

IncCounter increment a counter metric.

func (*FakeMonitoringClient) NewCounter

func (c *FakeMonitoringClient) NewCounter(name, desc string)

NewCounter creates a new counter metric.

func (*FakeMonitoringClient) NewLatency

func (c *FakeMonitoringClient) NewLatency(name, desc string)

NewLatency creates a new latency metric.

Jump to

Keyboard shortcuts

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