MCPcopy
hub / github.com/grafana/tempo / assertMetricCountEquals

Function assertMetricCountEquals

integration/operations/operational_metrics_test.go:225–238  ·  view source on GitHub ↗

nolint:unparam

(t *testing.T, service *e2e.HTTPService, metric string, expected float64, labelValues map[string]string)

Source from the content-addressed store, hash-verified

223
224// nolint:unparam
225func assertMetricCountEquals(t *testing.T, service *e2e.HTTPService, metric string, expected float64, labelValues map[string]string) {
226 t.Helper()
227 opts := []e2e.MetricsOption{e2e.WithMetricCount}
228 if len(labelValues) > 0 {
229 matchers := make([]*labels.Matcher, 0, len(labelValues))
230 for name, value := range labelValues {
231 matchers = append(matchers, &labels.Matcher{Type: labels.MatchEqual, Name: name, Value: value})
232 }
233 opts = append(opts, e2e.WithLabelMatchers(matchers...))
234 }
235 sums, err := service.SumMetrics([]string{metric}, opts...)
236 require.NoError(t, err)
237 require.Equal(t, expected, sums[0])
238}
239
240func assertMetricInDelta(t *testing.T, service *e2e.HTTPService, metric string, expected, delta float64, labelValues map[string]string) {
241 t.Helper()

Callers 1

TestReadMetricsFunction · 0.85

Calls 1

EqualMethod · 0.45

Tested by

no test coverage detected