force rfc 3339 date format in metrics push (#2402)
This commit is contained in:
parent
05c1825622
commit
380cbf70a9
|
@ -26,8 +26,8 @@ func (a *apic) GetMetrics() (*models.Metrics, error) {
|
||||||
machinesInfo[i] = &models.MetricsAgentInfo{
|
machinesInfo[i] = &models.MetricsAgentInfo{
|
||||||
Version: machine.Version,
|
Version: machine.Version,
|
||||||
Name: machine.MachineId,
|
Name: machine.MachineId,
|
||||||
LastUpdate: machine.UpdatedAt.String(),
|
LastUpdate: machine.UpdatedAt.Format(time.RFC3339),
|
||||||
LastPush: ptr.OrEmpty(machine.LastPush).String(),
|
LastPush: ptr.OrEmpty(machine.LastPush).Format(time.RFC3339),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ func (a *apic) GetMetrics() (*models.Metrics, error) {
|
||||||
Version: bouncer.Version,
|
Version: bouncer.Version,
|
||||||
CustomName: bouncer.Name,
|
CustomName: bouncer.Name,
|
||||||
Name: bouncer.Type,
|
Name: bouncer.Type,
|
||||||
LastPull: bouncer.LastPull.String(),
|
LastPull: bouncer.LastPull.Format(time.RFC3339),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -309,30 +309,30 @@ func TestAPICGetMetrics(t *testing.T) {
|
||||||
Bouncers: []*models.MetricsBouncerInfo{
|
Bouncers: []*models.MetricsBouncerInfo{
|
||||||
{
|
{
|
||||||
CustomName: "1",
|
CustomName: "1",
|
||||||
LastPull: time.Time{}.String(),
|
LastPull: time.Time{}.Format(time.RFC3339),
|
||||||
}, {
|
}, {
|
||||||
CustomName: "2",
|
CustomName: "2",
|
||||||
LastPull: time.Time{}.String(),
|
LastPull: time.Time{}.Format(time.RFC3339),
|
||||||
}, {
|
}, {
|
||||||
CustomName: "3",
|
CustomName: "3",
|
||||||
LastPull: time.Time{}.String(),
|
LastPull: time.Time{}.Format(time.RFC3339),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Machines: []*models.MetricsAgentInfo{
|
Machines: []*models.MetricsAgentInfo{
|
||||||
{
|
{
|
||||||
Name: "a",
|
Name: "a",
|
||||||
LastPush: time.Time{}.String(),
|
LastPush: time.Time{}.Format(time.RFC3339),
|
||||||
LastUpdate: time.Time{}.String(),
|
LastUpdate: time.Time{}.Format(time.RFC3339),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "b",
|
Name: "b",
|
||||||
LastPush: time.Time{}.String(),
|
LastPush: time.Time{}.Format(time.RFC3339),
|
||||||
LastUpdate: time.Time{}.String(),
|
LastUpdate: time.Time{}.Format(time.RFC3339),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "c",
|
Name: "c",
|
||||||
LastPush: time.Time{}.String(),
|
LastPush: time.Time{}.Format(time.RFC3339),
|
||||||
LastUpdate: time.Time{}.String(),
|
LastUpdate: time.Time{}.Format(time.RFC3339),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue