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

Function TestHistogramOverridesConfig

modules/generator/registry/registry_test.go:381–415  ·  modules/generator/registry/registry_test.go::TestHistogramOverridesConfig
(t *testing.T)

Source from the content-addressed store, hash-verified

379}
380
381func TestHistogramOverridesConfig(t *testing.T) {
382 cases := []struct {
383 name string
384 nativeHistogramMode HistogramMode
385 typeOfHistogram interface{}
386 }{
387 {
388 "classic",
389 HistogramModeClassic,
390 &histogram{},
391 },
392 {
393 "native",
394 HistogramModeNative,
395 &nativeHistogram{},
396 },
397 {
398 "both",
399 HistogramModeBoth,
400 &nativeHistogram{},
401 },
402 }
403
404 for _, c := range cases {
405 t.Run(c.name, func(t *testing.T) {
406 appender := &capturingAppender{}
407 overrides := &mockOverrides{}
408 registry := New(&Config{}, overrides, "test", appender, log.NewNopLogger(), noopLimiter)
409 defer registry.Close()
410
411 tt := registry.NewHistogram("histogram", []float64{1.0, 2.0}, c.nativeHistogramMode)
412 require.IsType(t, c.typeOfHistogram, tt)
413 })
414 }
415}
416
417func collectRegistryMetricsAndCountEntities(r *ManagedRegistry, appender *capturingAppender) int {
418 r.CollectMetrics(context.Background())

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
CloseMethod · 0.65
NewHistogramMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected