Skip to content

Commit b0cdec2

Browse files
authored
Use time.Time for timestamps in Runtimeinfo (#777)
Signed-off-by: Maximilian Gaß <[email protected]>
1 parent 6cd29bd commit b0cdec2

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

api/prometheus/v1/api.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,18 +285,18 @@ type FlagsResult map[string]string
285285

286286
// RuntimeinfoResult contains the result from querying the runtimeinfo endpoint.
287287
type RuntimeinfoResult struct {
288-
StartTime string `json:"startTime"`
289-
CWD string `json:"CWD"`
290-
ReloadConfigSuccess bool `json:"reloadConfigSuccess"`
291-
LastConfigTime string `json:"lastConfigTime"`
292-
ChunkCount int `json:"chunkCount"`
293-
TimeSeriesCount int `json:"timeSeriesCount"`
294-
CorruptionCount int `json:"corruptionCount"`
295-
GoroutineCount int `json:"goroutineCount"`
296-
GOMAXPROCS int `json:"GOMAXPROCS"`
297-
GOGC string `json:"GOGC"`
298-
GODEBUG string `json:"GODEBUG"`
299-
StorageRetention string `json:"storageRetention"`
288+
StartTime time.Time `json:"startTime"`
289+
CWD string `json:"CWD"`
290+
ReloadConfigSuccess bool `json:"reloadConfigSuccess"`
291+
LastConfigTime time.Time `json:"lastConfigTime"`
292+
ChunkCount int `json:"chunkCount"`
293+
TimeSeriesCount int `json:"timeSeriesCount"`
294+
CorruptionCount int `json:"corruptionCount"`
295+
GoroutineCount int `json:"goroutineCount"`
296+
GOMAXPROCS int `json:"GOMAXPROCS"`
297+
GOGC string `json:"GOGC"`
298+
GODEBUG string `json:"GODEBUG"`
299+
StorageRetention string `json:"storageRetention"`
300300
}
301301

302302
// SnapshotResult contains the result from querying the snapshot endpoint.

api/prometheus/v1/api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,10 +646,10 @@ func TestAPIs(t *testing.T) {
646646
"storageRetention": "1d",
647647
},
648648
res: RuntimeinfoResult{
649-
StartTime: "2020-05-18T15:52:53.4503113Z",
649+
StartTime: time.Date(2020, 5, 18, 15, 52, 53, 450311300, time.UTC),
650650
CWD: "/prometheus",
651651
ReloadConfigSuccess: true,
652-
LastConfigTime: "2020-05-18T15:52:56Z",
652+
LastConfigTime: time.Date(2020, 5, 18, 15, 52, 56, 0, time.UTC),
653653
ChunkCount: 72692,
654654
TimeSeriesCount: 18476,
655655
CorruptionCount: 0,

0 commit comments

Comments
 (0)