@@ -144,6 +144,13 @@ func TestAPIs(t *testing.T) {
144
144
}
145
145
}
146
146
147
+ doRuntimeinfo := func () func () (interface {}, Warnings , error ) {
148
+ return func () (interface {}, Warnings , error ) {
149
+ v , err := promAPI .Runtimeinfo (context .Background ())
150
+ return v , nil , err
151
+ }
152
+ }
153
+
147
154
doLabelNames := func (label string ) func () (interface {}, Warnings , error ) {
148
155
return func () (interface {}, Warnings , error ) {
149
156
return promAPI .LabelNames (context .Background ())
@@ -605,6 +612,48 @@ func TestAPIs(t *testing.T) {
605
612
err : fmt .Errorf ("some error" ),
606
613
},
607
614
615
+ {
616
+ do : doRuntimeinfo (),
617
+ reqMethod : "GET" ,
618
+ reqPath : "/api/v1/status/runtimeinfo" ,
619
+ inErr : fmt .Errorf ("some error" ),
620
+ err : fmt .Errorf ("some error" ),
621
+ },
622
+
623
+ {
624
+ do : doRuntimeinfo (),
625
+ reqMethod : "GET" ,
626
+ reqPath : "/api/v1/status/runtimeinfo" ,
627
+ inRes : map [string ]interface {}{
628
+ "startTime" : "2020-05-18T15:52:53.4503113Z" ,
629
+ "CWD" : "/prometheus" ,
630
+ "reloadConfigSuccess" : true ,
631
+ "lastConfigTime" : "2020-05-18T15:52:56Z" ,
632
+ "chunkCount" : 72692 ,
633
+ "timeSeriesCount" : 18476 ,
634
+ "corruptionCount" : 0 ,
635
+ "goroutineCount" : 217 ,
636
+ "GOMAXPROCS" : 2 ,
637
+ "GOGC" : "100" ,
638
+ "GODEBUG" : "allocfreetrace" ,
639
+ "storageRetention" : "1d" ,
640
+ },
641
+ res : RuntimeinfoResult {
642
+ StartTime : "2020-05-18T15:52:53.4503113Z" ,
643
+ CWD : "/prometheus" ,
644
+ ReloadConfigSuccess : true ,
645
+ LastConfigTime : "2020-05-18T15:52:56Z" ,
646
+ ChunkCount : 72692 ,
647
+ TimeSeriesCount : 18476 ,
648
+ CorruptionCount : 0 ,
649
+ GoroutineCount : 217 ,
650
+ GOMAXPROCS : 2 ,
651
+ GOGC : "100" ,
652
+ GODEBUG : "allocfreetrace" ,
653
+ StorageRetention : "1d" ,
654
+ },
655
+ },
656
+
608
657
{
609
658
do : doAlertManagers (),
610
659
reqMethod : "GET" ,
0 commit comments