MCPcopy Create free account
hub / github.com/prometheus/common / TestSampleHistogramPairJSON

Function TestSampleHistogramPairJSON

model/value_histogram_test.go:301–383  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

299}
300
301func TestSampleHistogramPairJSON(t *testing.T) {
302 input := []struct {
303 plain string
304 value SampleHistogramPair
305 }{
306 {
307 plain: `[
308 1234.567,
309 {
310 "count":"6",
311 "sum":"3897",
312 "buckets":[
313 [
314 1,
315 "-4870.992343051145",
316 "-4466.7196729968955",
317 "1"
318 ],
319 [
320 1,
321 "-861.0779292198035",
322 "-789.6119426088657",
323 "1"
324 ],
325 [
326 1,
327 "-558.3399591246119",
328 "-512",
329 "1"
330 ],
331 [
332 0,
333 "2048",
334 "2233.3598364984477",
335 "1"
336 ],
337 [
338 0,
339 "2896.3093757400984",
340 "3158.4477704354626",
341 "1"
342 ],
343 [
344 0,
345 "4466.7196729968955",
346 "4870.992343051145",
347 "1"
348 ]
349 ]
350 }
351 ]`,
352 value: SampleHistogramPair{
353 Histogram: genSampleHistogram(),
354 Timestamp: 1234567,
355 },
356 },
357 }
358

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.95
genSampleHistogramFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected