metricstest

package
v0.0.0-...-5cf3e1d Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package metricstest provides utilities for metrics testing.

Index

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 MakeTEFBackendDuration(code int, service string) string

func MakeTEFBackendErrors

func MakeTEFBackendErrors() string

func MakeTEFBackendRequests

func MakeTEFBackendRequests(code int, service string) string

func MakeTEFEventTypePublished

func MakeTEFEventTypePublished(code int, source, eventtype string) string

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)

Jump to

Keyboard shortcuts

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