Skip to content

Commit 1b452ee

Browse files
author
Joeri Hermans
committed
Update GPUs exporter
1 parent 97bdbf4 commit 1b452ee

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gpus.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ func ParseTotalGPUs() float64 {
5151
output := string(Execute("sinfo", args))
5252
if len(output) > 0 {
5353
for _, line := range strings.Split(output, "\n") {
54-
log.Infof("Line %s: ", line)
55-
descriptor := strings.Split(line, " ")[0]
56-
log.Infof("Descriptor %s: ", descriptor)
54+
if len(line) > 0 {
55+
log.Infof("Line %s: ", line)
56+
descriptor := strings.Split(line, " ")[0]
57+
log.Infof("Descriptor %s: ", descriptor)
58+
}
5759
}
5860
}
5961

0 commit comments

Comments
 (0)