Skip to content

Commit

Permalink
Bug related with jobs with more than one partition resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Carnero committed Oct 18, 2017
1 parent 94d9520 commit 6e9faad
Show file tree
Hide file tree
Showing 4 changed files with 735 additions and 9 deletions.
15 changes: 8 additions & 7 deletions acct.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ import (
)

const (
aJOBID = iota
aNAME = iota
aUSERNAME = iota
aSTATE = iota
aFIELDS = iota
aJOBID = iota
aNAME = iota
aUSERNAME = iota
aPARTITION = iota
aSTATE = iota
aFIELDS = iota
)

const (
acctCommand = "sacct -n -a -X -o \"JobIDRaw,JobName%%20,User%%20,State%%20\" -S%02d:%02d:%02d -sBF,CA,CD,CF,F,NF,PR,RS,S,TO | grep -v 'PENDING\\|COMPLETING\\|RUNNING'"
acctCommand = "sacct -n -a -X -o \"JobIDRaw,JobName%%20,User%%20,Partition%%20,State%%20\" -S%02d:%02d:%02d -sBF,CA,CD,CF,F,NF,PR,RS,S,TO | grep -v 'PENDING\\|COMPLETING\\|RUNNING'"
)

func (sc *SlurmCollector) collectAcct(ch chan<- prometheus.Metric) {
Expand Down Expand Up @@ -83,7 +84,7 @@ func (sc *SlurmCollector) collectAcct(ch chan<- prometheus.Metric) {
sc.status,
prometheus.GaugeValue,
float64(status),
fields[aJOBID], fields[aNAME], fields[aUSERNAME],
fields[aJOBID], fields[aNAME], fields[aUSERNAME], fields[aPARTITION],
)
sc.alreadyRegistered = append(sc.alreadyRegistered, fields[aJOBID])
//log.Debugln("Job " + fields[aJOBID] + " finished with state " + fields[aSTATE])
Expand Down
Loading

0 comments on commit 6e9faad

Please sign in to comment.