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

Function TestVectorHistogramJSON

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

Source from the content-addressed store, hash-verified

493}
494
495func TestVectorHistogramJSON(t *testing.T) {
496 input := []struct {
497 plain string
498 value Vector
499 }{
500 {
501 plain: `[
502 {
503 "metric":{
504 "__name__":"test_metric"
505 },
506 "histogram":[
507 1234.567,
508 {
509 "count":"6",
510 "sum":"3897",
511 "buckets":[
512 [
513 1,
514 "-4870.992343051145",
515 "-4466.7196729968955",
516 "1"
517 ],
518 [
519 1,
520 "-861.0779292198035",
521 "-789.6119426088657",
522 "1"
523 ],
524 [
525 1,
526 "-558.3399591246119",
527 "-512",
528 "1"
529 ],
530 [
531 0,
532 "2048",
533 "2233.3598364984477",
534 "1"
535 ],
536 [
537 0,
538 "2896.3093757400984",
539 "3158.4477704354626",
540 "1"
541 ],
542 [
543 0,
544 "4466.7196729968955",
545 "4870.992343051145",
546 "1"
547 ]
548 ]
549 }
550 ]
551 }
552 ]`,

Callers

nothing calls this directly

Calls 2

genSampleHistogramFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected