fix: parse error timestamps as float
This commit is contained in:
parent
088024ad9c
commit
0a1b45b32a
1 changed files with 3 additions and 2 deletions
|
|
@ -304,13 +304,14 @@ func ParseAggregatedOutput(raw string) (*AggregatedHistory, error) {
|
||||||
if len(parts) < 6 {
|
if len(parts) < 6 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ts, err := strconv.ParseInt(parts[0], 10, 64)
|
// Caddy logs ts as a float (unix seconds with fractional part).
|
||||||
|
tsFloat, err := strconv.ParseFloat(parts[0], 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
status, _ := strconv.Atoi(parts[1])
|
status, _ := strconv.Atoi(parts[1])
|
||||||
h.Errors = append(h.Errors, ErrorEntry{
|
h.Errors = append(h.Errors, ErrorEntry{
|
||||||
Time: time.Unix(ts, 0),
|
Time: time.Unix(int64(tsFloat), 0),
|
||||||
Status: status,
|
Status: status,
|
||||||
Method: parts[2],
|
Method: parts[2],
|
||||||
URI: parts[3],
|
URI: parts[3],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue