@@ -385,110 +385,6 @@ request_duration_microseconds_count 2693
385
385
},
386
386
},
387
387
},
388
- // 5: The histogram with unit.
389
- {
390
- in : `
391
- # HELP request_duration_microseconds The response latency.
392
- # TYPE request_duration_microseconds histogram
393
- # UNIT request_duration_microseconds microseconds
394
- request_duration_microseconds_bucket{le="100"} 123
395
- request_duration_microseconds_bucket{le="120"} 412
396
- request_duration_microseconds_bucket{le="144"} 592
397
- request_duration_microseconds_bucket{le="172.8"} 1524
398
- request_duration_microseconds_bucket{le="+Inf"} 2693
399
- request_duration_microseconds_sum 1.7560473e+06
400
- request_duration_microseconds_count 2693
401
- ` ,
402
- out : []* dto.MetricFamily {
403
- {
404
- Name : proto .String ("request_duration_microseconds" ),
405
- Help : proto .String ("The response latency." ),
406
- Type : dto .MetricType_HISTOGRAM .Enum (),
407
- Unit : proto .String ("microseconds" ),
408
- Metric : []* dto.Metric {
409
- & dto.Metric {
410
- Histogram : & dto.Histogram {
411
- SampleCount : proto .Uint64 (2693 ),
412
- SampleSum : proto .Float64 (1756047.3 ),
413
- Bucket : []* dto.Bucket {
414
- & dto.Bucket {
415
- UpperBound : proto .Float64 (100 ),
416
- CumulativeCount : proto .Uint64 (123 ),
417
- },
418
- & dto.Bucket {
419
- UpperBound : proto .Float64 (120 ),
420
- CumulativeCount : proto .Uint64 (412 ),
421
- },
422
- & dto.Bucket {
423
- UpperBound : proto .Float64 (144 ),
424
- CumulativeCount : proto .Uint64 (592 ),
425
- },
426
- & dto.Bucket {
427
- UpperBound : proto .Float64 (172.8 ),
428
- CumulativeCount : proto .Uint64 (1524 ),
429
- },
430
- & dto.Bucket {
431
- UpperBound : proto .Float64 (math .Inf (+ 1 )),
432
- CumulativeCount : proto .Uint64 (2693 ),
433
- },
434
- },
435
- },
436
- },
437
- },
438
- },
439
- },
440
- },
441
- // 6: A counter with unit
442
- {
443
- in : `
444
- # HELP name something to do with time
445
- # TYPE name counter
446
- # UNIT name seconds
447
- name{labelname="val1",basename="basevalue"} 50.0
448
- name{labelname="val2",basename="basevalue"} 0.24 2
449
- ` ,
450
- out : []* dto.MetricFamily {
451
- {
452
- Name : proto .String ("name" ),
453
- Help : proto .String ("something to do with time" ),
454
- Type : dto .MetricType_COUNTER .Enum (),
455
- Unit : proto .String ("seconds" ),
456
- Metric : []* dto.Metric {
457
- & dto.Metric {
458
- Label : []* dto.LabelPair {
459
- & dto.LabelPair {
460
- Name : proto .String ("labelname" ),
461
- Value : proto .String ("val1" ),
462
- },
463
- & dto.LabelPair {
464
- Name : proto .String ("basename" ),
465
- Value : proto .String ("basevalue" ),
466
- },
467
- },
468
- Counter : & dto.Counter {
469
- Value : proto .Float64 (50 ),
470
- },
471
- },
472
- & dto.Metric {
473
- Label : []* dto.LabelPair {
474
- & dto.LabelPair {
475
- Name : proto .String ("labelname" ),
476
- Value : proto .String ("val2" ),
477
- },
478
- & dto.LabelPair {
479
- Name : proto .String ("basename" ),
480
- Value : proto .String ("basevalue" ),
481
- },
482
- },
483
- Counter : & dto.Counter {
484
- Value : proto .Float64 (.24 ),
485
- },
486
- TimestampMs : proto .Int64 (2 ),
487
- },
488
- },
489
- },
490
- },
491
- },
492
388
}
493
389
494
390
for i , scenario := range scenarios {
0 commit comments