Documentation ¶
Overview ¶
Package telemetrytest provides a mock implementation of the telemetry client for testing purposes
Index ¶
- type MockClient
- func (c *MockClient) ApplyOps(args ...telemetry.Option)
- func (c *MockClient) ConfigChange(args []telemetry.Configuration)
- func (c *MockClient) Count(ns telemetry.Namespace, name string, val float64, tags []string, common bool)
- func (c *MockClient) ProductChange(namespace telemetry.Namespace, enabled bool, ...)
- func (c *MockClient) ProductStop(namespace telemetry.Namespace)
- func (c *MockClient) Record(ns telemetry.Namespace, _ telemetry.MetricKind, name string, val float64, ...)
- func (c *MockClient) RegisterAppConfig(name string, val interface{}, origin telemetry.Origin)
- func (c *MockClient) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockClient ¶
type MockClient struct { mock.Mock Started bool Configuration []telemetry.Configuration Integrations []string ProfilerEnabled bool AsmEnabled bool Metrics map[telemetry.Namespace]map[string]float64 // contains filtered or unexported fields }
MockClient implements Client and is used for testing purposes outside the telemetry package, e.g. the tracer and profiler.
func (*MockClient) ApplyOps ¶
func (c *MockClient) ApplyOps(args ...telemetry.Option)
ApplyOps is used to record the number of ApplyOps method calls.
func (*MockClient) ConfigChange ¶
func (c *MockClient) ConfigChange(args []telemetry.Configuration)
ConfigChange is a mock for the ConfigChange method.
func (*MockClient) Count ¶
func (c *MockClient) Count(ns telemetry.Namespace, name string, val float64, tags []string, common bool)
Count counts the value for the given metric
func (*MockClient) ProductChange ¶
func (c *MockClient) ProductChange(namespace telemetry.Namespace, enabled bool, configuration []telemetry.Configuration)
ProductChange starts and adds configuration data to the mock client.
func (*MockClient) ProductStop ¶
func (c *MockClient) ProductStop(namespace telemetry.Namespace)
ProductStop signals a product has stopped and disables that product in the mock client. ProductStop is NOOP for the tracer namespace, since the tracer is not considered a product.
func (*MockClient) Record ¶
func (c *MockClient) Record(ns telemetry.Namespace, _ telemetry.MetricKind, name string, val float64, tags []string, common bool)
Record stores the value for the given metric. It is currently mocked for `Gauge` and `Distribution` metric types.
func (*MockClient) RegisterAppConfig ¶
func (c *MockClient) RegisterAppConfig(name string, val interface{}, origin telemetry.Origin)