Use time.Time for timestamps in Runtimeinfo (#777)

Signed-off-by: Maximilian Gaß <m.gass@babiel.com>
This commit is contained in:
Maximilian Gaß 2020-06-24 17:55:36 +02:00 committed by GitHub
parent 6cd29bd38a
commit b0cdec211b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View File

@ -285,10 +285,10 @@ type FlagsResult map[string]string
// RuntimeinfoResult contains the result from querying the runtimeinfo endpoint.
type RuntimeinfoResult struct {
StartTime string `json:"startTime"`
StartTime time.Time `json:"startTime"`
CWD string `json:"CWD"`
ReloadConfigSuccess bool `json:"reloadConfigSuccess"`
LastConfigTime string `json:"lastConfigTime"`
LastConfigTime time.Time `json:"lastConfigTime"`
ChunkCount int `json:"chunkCount"`
TimeSeriesCount int `json:"timeSeriesCount"`
CorruptionCount int `json:"corruptionCount"`

View File

@ -646,10 +646,10 @@ func TestAPIs(t *testing.T) {
"storageRetention": "1d",
},
res: RuntimeinfoResult{
StartTime: "2020-05-18T15:52:53.4503113Z",
StartTime: time.Date(2020, 5, 18, 15, 52, 53, 450311300, time.UTC),
CWD: "/prometheus",
ReloadConfigSuccess: true,
LastConfigTime: "2020-05-18T15:52:56Z",
LastConfigTime: time.Date(2020, 5, 18, 15, 52, 56, 0, time.UTC),
ChunkCount: 72692,
TimeSeriesCount: 18476,
CorruptionCount: 0,