@@ -45,42 +45,44 @@ func TestPrometheusRecorder(t *testing.T) {
4545 addMetrics : func (r * kooperprometheus.Recorder ) {
4646 ctx := context .TODO ()
4747 t0 := time .Now ()
48- r .ObserveResourceInQueueDuration (ctx , "ctrl1" , t0 .Add (- 3 * time .Second ))
49- r .ObserveResourceInQueueDuration (ctx , "ctrl1" , t0 .Add (- 280 * time .Millisecond ))
50- r .ObserveResourceInQueueDuration (ctx , "ctrl2" , t0 .Add (- 7 * time .Second ))
48+ r .ObserveResourceInQueueDuration (ctx , "ctrl1" , t0 .Add (- 30 * time .Second ))
49+ r .ObserveResourceInQueueDuration (ctx , "ctrl1" , t0 .Add (- 127 * time .Millisecond ))
50+ r .ObserveResourceInQueueDuration (ctx , "ctrl2" , t0 .Add (- 70 * time .Millisecond ))
5151 r .ObserveResourceInQueueDuration (ctx , "ctrl2" , t0 .Add (- 35 * time .Millisecond ))
52- r .ObserveResourceInQueueDuration (ctx , "ctrl2" , t0 .Add (- 770 * time .Millisecond ))
53- r .ObserveResourceInQueueDuration (ctx , "ctrl2" , t0 .Add (- 17 * time .Millisecond ))
52+ r .ObserveResourceInQueueDuration (ctx , "ctrl2" , t0 .Add (- 500 * time .Millisecond ))
53+ r .ObserveResourceInQueueDuration (ctx , "ctrl2" , t0 .Add (- 2 * time .Second ))
5454 },
5555 expMetrics : []string {
5656 `# HELP kooper_controller_event_in_queue_duration_seconds The duration of an event in the queue.` ,
5757 `# TYPE kooper_controller_event_in_queue_duration_seconds histogram` ,
5858
59- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="0.005"} 0` ,
6059 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="0.01"} 0` ,
61- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="0.025"} 0` ,
6260 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="0.05"} 0` ,
6361 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="0.1"} 0` ,
64- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="0.25"} 0 ` ,
62+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="0.25"} 1 ` ,
6563 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="0.5"} 1` ,
6664 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="1"} 1` ,
67- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="2.5"} 1` ,
68- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="5"} 2` ,
69- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="10"} 2` ,
65+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="3"} 1` ,
66+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="10"} 1` ,
67+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="20"} 1` ,
68+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="60"} 2` ,
69+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="150"} 2` ,
70+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="300"} 2` ,
7071 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl1",le="+Inf"} 2` ,
7172 `kooper_controller_event_in_queue_duration_seconds_count{controller="ctrl1"} 2` ,
7273
73- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="0.005"} 0` ,
7474 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="0.01"} 0` ,
75- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="0.025"} 1` ,
76- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="0.05"} 2` ,
75+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="0.05"} 1` ,
7776 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="0.1"} 2` ,
7877 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="0.25"} 2` ,
7978 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="0.5"} 2` ,
8079 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="1"} 3` ,
81- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="2.5"} 3` ,
82- `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="5"} 3` ,
80+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="3"} 4` ,
8381 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="10"} 4` ,
82+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="20"} 4` ,
83+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="60"} 4` ,
84+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="150"} 4` ,
85+ `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="300"} 4` ,
8486 `kooper_controller_event_in_queue_duration_seconds_bucket{controller="ctrl2",le="+Inf"} 4` ,
8587 `kooper_controller_event_in_queue_duration_seconds_count{controller="ctrl2"} 4` ,
8688 },
0 commit comments