MCPcopy
hub / github.com/prometheus/prometheus / TestHistogramFixtureValid

Function TestHistogramFixtureValid

storage/remote/codec_test.go:152–171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150)
151
152func TestHistogramFixtureValid(t *testing.T) {
153 for _, ts := range writeRequestFixture.Timeseries {
154 for _, h := range ts.Histograms {
155 if h.IsFloatHistogram() {
156 require.NoError(t, h.ToFloatHistogram().Validate())
157 } else {
158 require.NoError(t, h.ToIntHistogram().Validate())
159 }
160 }
161 }
162 for _, ts := range writeV2RequestFixture.Timeseries {
163 for _, h := range ts.Histograms {
164 if h.IsFloatHistogram() {
165 require.NoError(t, h.ToFloatHistogram().Validate())
166 } else {
167 require.NoError(t, h.ToIntHistogram().Validate())
168 }
169 }
170 }
171}
172
173func TestWriteV2RequestFixture(t *testing.T) {
174 // Generate dynamically writeV2RequestFixture, reusing v1 fixture elements.

Callers

nothing calls this directly

Calls 4

IsFloatHistogramMethod · 0.45
ValidateMethod · 0.45
ToFloatHistogramMethod · 0.45
ToIntHistogramMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…