Skip to content

Commit

Permalink
refactor: Use UnixMilli for slurm job times
Browse files Browse the repository at this point in the history
* Grafana expects a millisecond epoch for to and from query params

Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Jan 4, 2024
1 parent 5dede8c commit 90e0bb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/jobstats/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func NodelistParser(nodelistExp string) []string {
// Converts a date in a given layout to unix timestamp of the date
func TimeToTimestamp(layout string, date string) int64 {
if t, err := time.Parse(layout, date); err == nil {
return int64(t.Local().Unix())
return int64(t.Local().UnixMilli())
}
return 0
}

0 comments on commit 90e0bb4

Please sign in to comment.