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

Function TestSampleHistogramJSON

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

Source from the content-addressed store, hash-verified

401}
402
403func TestSampleHistogramJSON(t *testing.T) {
404 input := []struct {
405 plain string
406 value Sample
407 }{
408 {
409 plain: `{
410 "metric":{
411 "__name__":"test_metric"
412 },
413 "histogram":[
414 1234.567,
415 {
416 "count":"6",
417 "sum":"3897",
418 "buckets":[
419 [
420 1,
421 "-4870.992343051145",
422 "-4466.7196729968955",
423 "1"
424 ],
425 [
426 1,
427 "-861.0779292198035",
428 "-789.6119426088657",
429 "1"
430 ],
431 [
432 1,
433 "-558.3399591246119",
434 "-512",
435 "1"
436 ],
437 [
438 0,
439 "2048",
440 "2233.3598364984477",
441 "1"
442 ],
443 [
444 0,
445 "2896.3093757400984",
446 "3158.4477704354626",
447 "1"
448 ],
449 [
450 0,
451 "4466.7196729968955",
452 "4870.992343051145",
453 "1"
454 ]
455 ]
456 }
457 ]
458 }`,
459 value: Sample{
460 Metric: Metric{

Callers

nothing calls this directly

Calls 2

genSampleHistogramFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected