Documentation ¶
Overview ¶
Package metricstest provides utilities for metrics testing.
Index ¶
- func EnsureMetricEventTypePublished(t *testing.T, collector metrics.PublishingMetricsCollector, count int)
- func EnsureMetricLatency(t *testing.T, collector metrics.PublishingMetricsCollector, count int)
- func EnsureMetricMatchesTextExpositionFormat(t *testing.T, collector metrics.PublishingMetricsCollector, tef string, ...)
- func MakeTEFBackendDuration(code int, service string) string
- func MakeTEFBackendErrors() string
- func MakeTEFBackendRequests(code int, service string) string
- func MakeTEFEventTypePublished(code int, source, eventtype string) string
- type PublishingMetricsCollectorStub
- func (p PublishingMetricsCollectorStub) Collect(_ chan<- prometheus.Metric)
- func (p PublishingMetricsCollectorStub) Describe(_ chan<- *prometheus.Desc)
- func (p PublishingMetricsCollectorStub) RecordError()
- func (p PublishingMetricsCollectorStub) RecordEventType(_, _ string, _ int)
- func (p PublishingMetricsCollectorStub) RecordLatency(_ time.Duration, _ int, _ string)
- func (p PublishingMetricsCollectorStub) RecordRequests(_ int, _ string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureMetricEventTypePublished ¶
func EnsureMetricEventTypePublished(t *testing.T, collector metrics.PublishingMetricsCollector, count int)
EnsureMetricEventTypePublished ensures metric eventing_epp_event_type_published_total exists.
func EnsureMetricLatency ¶
func EnsureMetricLatency(t *testing.T, collector metrics.PublishingMetricsCollector, count int)
EnsureMetricLatency ensures metric eventing_epp_backend_duration_seconds exists.
func EnsureMetricMatchesTextExpositionFormat ¶
func EnsureMetricMatchesTextExpositionFormat(t *testing.T, collector metrics.PublishingMetricsCollector, tef string, metricNames ...string)
EnsureMetricMatchesTextExpositionFormat ensures that metrics collected by the given collector match the given metric output in TextExpositionFormat. This is useful to compare metrics with their given labels.
func MakeTEFBackendDuration ¶
func MakeTEFBackendErrors ¶
func MakeTEFBackendErrors() string
func MakeTEFBackendRequests ¶
Types ¶
type PublishingMetricsCollectorStub ¶
type PublishingMetricsCollectorStub struct { }
func (PublishingMetricsCollectorStub) Collect ¶
func (p PublishingMetricsCollectorStub) Collect(_ chan<- prometheus.Metric)
func (PublishingMetricsCollectorStub) Describe ¶
func (p PublishingMetricsCollectorStub) Describe(_ chan<- *prometheus.Desc)
func (PublishingMetricsCollectorStub) RecordError ¶
func (p PublishingMetricsCollectorStub) RecordError()
func (PublishingMetricsCollectorStub) RecordEventType ¶
func (p PublishingMetricsCollectorStub) RecordEventType(_, _ string, _ int)
func (PublishingMetricsCollectorStub) RecordLatency ¶
func (p PublishingMetricsCollectorStub) RecordLatency(_ time.Duration, _ int, _ string)
func (PublishingMetricsCollectorStub) RecordRequests ¶
func (p PublishingMetricsCollectorStub) RecordRequests(_ int, _ string)
Click to show internal directories.
Click to hide internal directories.