Documentation
¶
Overview ¶
Package telemetrytest provides a mock implementation of the telemetry client for testing purposes
Index ¶
- func CheckConfig(t *testing.T, cfgs []telemetry.Configuration, key string, value any)
- type LogLine
- type MetricKey
- type MockClient
- func (m *MockClient) AddFlushTicker(ticker func(telemetry.Client))
- func (m *MockClient) AppStart()
- func (m *MockClient) AppStop()
- func (m *MockClient) Close() error
- func (m *MockClient) Count(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
- func (m *MockClient) Distribution(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
- func (m *MockClient) Flush()
- func (m *MockClient) Gauge(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
- func (m *MockClient) Log(level telemetry.LogLevel, text string, options ...telemetry.LogOption)
- func (m *MockClient) MarkIntegrationAsLoaded(integration telemetry.Integration)
- func (m *MockClient) ProductStartError(product telemetry.Namespace, err error)
- func (m *MockClient) ProductStarted(product telemetry.Namespace)
- func (m *MockClient) ProductStopped(product telemetry.Namespace)
- func (m *MockClient) Rate(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
- func (m *MockClient) RegisterAppConfig(key string, value any, origin telemetry.Origin)
- func (m *MockClient) RegisterAppConfigs(kvs ...telemetry.Configuration)
- type MockMetricHandle
- type RecordClient
- func (r *RecordClient) AddFlushTicker(func(telemetry.Client))
- func (r *RecordClient) AppStart()
- func (r *RecordClient) AppStop()
- func (r *RecordClient) Close() error
- func (r *RecordClient) Count(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
- func (r *RecordClient) Distribution(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
- func (r *RecordClient) Flush()
- func (r *RecordClient) Gauge(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
- func (r *RecordClient) Log(level telemetry.LogLevel, text string, _ ...telemetry.LogOption)
- func (r *RecordClient) MarkIntegrationAsLoaded(integration telemetry.Integration)
- func (r *RecordClient) ProductStartError(product telemetry.Namespace, _ error)
- func (r *RecordClient) ProductStarted(product telemetry.Namespace)
- func (r *RecordClient) ProductStopped(product telemetry.Namespace)
- func (r *RecordClient) Rate(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
- func (r *RecordClient) RegisterAppConfig(key string, value any, origin telemetry.Origin)
- func (r *RecordClient) RegisterAppConfigs(kvs ...telemetry.Configuration)
- type RecordMetricHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckConfig ¶
Types ¶
type MockClient ¶
MockClient implements Client and is used for testing purposes outside the telemetry package, e.g. the tracer and profiler.
func (*MockClient) AddFlushTicker ¶
func (m *MockClient) AddFlushTicker(ticker func(telemetry.Client))
func (*MockClient) AppStart ¶
func (m *MockClient) AppStart()
func (*MockClient) AppStop ¶
func (m *MockClient) AppStop()
func (*MockClient) Close ¶
func (m *MockClient) Close() error
func (*MockClient) Count ¶
func (m *MockClient) Count(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
func (*MockClient) Distribution ¶
func (m *MockClient) Distribution(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
func (*MockClient) Flush ¶
func (m *MockClient) Flush()
func (*MockClient) Gauge ¶
func (m *MockClient) Gauge(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
func (*MockClient) MarkIntegrationAsLoaded ¶
func (m *MockClient) MarkIntegrationAsLoaded(integration telemetry.Integration)
func (*MockClient) ProductStartError ¶
func (m *MockClient) ProductStartError(product telemetry.Namespace, err error)
func (*MockClient) ProductStarted ¶
func (m *MockClient) ProductStarted(product telemetry.Namespace)
func (*MockClient) ProductStopped ¶
func (m *MockClient) ProductStopped(product telemetry.Namespace)
func (*MockClient) Rate ¶
func (m *MockClient) Rate(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
func (*MockClient) RegisterAppConfig ¶
func (m *MockClient) RegisterAppConfig(key string, value any, origin telemetry.Origin)
func (*MockClient) RegisterAppConfigs ¶
func (m *MockClient) RegisterAppConfigs(kvs ...telemetry.Configuration)
type MockMetricHandle ¶
func (*MockMetricHandle) Get ¶
func (m *MockMetricHandle) Get() float64
func (*MockMetricHandle) Submit ¶
func (m *MockMetricHandle) Submit(value float64)
type RecordClient ¶
type RecordClient struct { Started bool Stopped bool Configuration []telemetry.Configuration Logs []LogLine Integrations []telemetry.Integration Products map[telemetry.Namespace]bool Metrics map[MetricKey]*RecordMetricHandle // contains filtered or unexported fields }
func (*RecordClient) AddFlushTicker ¶
func (r *RecordClient) AddFlushTicker(func(telemetry.Client))
func (*RecordClient) AppStart ¶
func (r *RecordClient) AppStart()
func (*RecordClient) AppStop ¶
func (r *RecordClient) AppStop()
func (*RecordClient) Close ¶
func (r *RecordClient) Close() error
func (*RecordClient) Count ¶
func (r *RecordClient) Count(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
func (*RecordClient) Distribution ¶
func (r *RecordClient) Distribution(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
func (*RecordClient) Flush ¶
func (r *RecordClient) Flush()
func (*RecordClient) Gauge ¶
func (r *RecordClient) Gauge(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
func (*RecordClient) MarkIntegrationAsLoaded ¶
func (r *RecordClient) MarkIntegrationAsLoaded(integration telemetry.Integration)
func (*RecordClient) ProductStartError ¶
func (r *RecordClient) ProductStartError(product telemetry.Namespace, _ error)
func (*RecordClient) ProductStarted ¶
func (r *RecordClient) ProductStarted(product telemetry.Namespace)
func (*RecordClient) ProductStopped ¶
func (r *RecordClient) ProductStopped(product telemetry.Namespace)
func (*RecordClient) Rate ¶
func (r *RecordClient) Rate(namespace telemetry.Namespace, name string, tags []string) telemetry.MetricHandle
func (*RecordClient) RegisterAppConfig ¶
func (r *RecordClient) RegisterAppConfig(key string, value any, origin telemetry.Origin)
func (*RecordClient) RegisterAppConfigs ¶
func (r *RecordClient) RegisterAppConfigs(kvs ...telemetry.Configuration)
type RecordMetricHandle ¶
type RecordMetricHandle struct {
// contains filtered or unexported fields
}
func (*RecordMetricHandle) Get ¶
func (m *RecordMetricHandle) Get() float64
func (*RecordMetricHandle) Submit ¶
func (m *RecordMetricHandle) Submit(value float64)
Click to show internal directories.
Click to hide internal directories.