MCPcopy
hub / github.com/prometheus/prometheus / addNativeHistogramsToTestSuite

Function addNativeHistogramsToTestSuite

storage/remote/read_handler_test.go:466–482  ·  view source on GitHub ↗
(t *testing.T, storage *teststorage.TestStorage, n int)

Source from the content-addressed store, hash-verified

464}
465
466func addNativeHistogramsToTestSuite(t *testing.T, storage *teststorage.TestStorage, n int) {
467 lbls := labels.FromStrings("__name__", "test_histogram_metric1", "baz", "qux")
468
469 app := storage.Appender(t.Context())
470 for i, fh := range tsdbutil.GenerateTestFloatHistograms(n) {
471 _, err := app.AppendHistogram(0, lbls, int64(i)*int64(60*time.Second/time.Millisecond), nil, fh)
472 require.NoError(t, err)
473 }
474
475 lbls = labels.FromStrings("__name__", "test_nhcb_metric1", "baz", "qux")
476 for i, fh := range tsdbutil.GenerateTestCustomBucketsFloatHistograms(n) {
477 _, err := app.AppendHistogram(0, lbls, int64(i)*int64(60*time.Second/time.Millisecond), nil, fh)
478 require.NoError(t, err)
479 }
480
481 require.NoError(t, app.Commit())
482}

Callers 2

TestSampledReadEndpointFunction · 0.85
TestStreamReadEndpointFunction · 0.85

Calls 7

FromStringsFunction · 0.92
AppenderInterface · 0.92
AppendHistogramMethod · 0.65
CommitMethod · 0.65
ContextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…