Skip to content

Commit

Permalink
change default sinfo json args
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavDhulipala committed Mar 28, 2024
1 parent a12e27f commit a80f8a7
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 111 deletions.
322 changes: 214 additions & 108 deletions exporter/fixtures/sinfo_dataparser.json
Original file line number Diff line number Diff line change
@@ -1,109 +1,215 @@
{
"meta": {
"plugins": {
"data_parser": "data_parser/v0.0.39",
"accounting_storage": "accounting_storage/slurmdbd"
},
"command": ["sinfo", "--json"],
"Slurm": {
"version": { "major": 23, "micro": 4, "minor": 2 },
"release": "23.02.4"
}
},
"sinfo": [
{
"port": 6818,
"node": { "state": ["ALLOCATED", "DRAIN"] },
"nodes": {
"allocated": 10,
"idle": 0,
"other": 0,
"total": 10,
"hostnames": [],
"addresses": [],
"nodes": ["cs62"]
},
"cpus": {
"allocated": 114,
"idle": 0,
"other": 526,
"total": 640,
"minimum": 64,
"maximum": 64,
"load": { "minimum": 2, "maximum": 1460 },
"per_node": { "max": { "set": false, "infinite": true, "number": 0 } }
},
"sockets": { "minimum": 2, "maximum": 2 },
"cores": { "minimum": 16, "maximum": 16 },
"threads": { "minimum": 2, "maximum": 2 },
"disk": { "minimum": 0, "maximum": 0 },
"memory": {
"minimum": 770000,
"maximum": 770000,
"free": {
"minimum": { "set": true, "infinite": false, "number": 428227 },
"maximum": { "set": true, "infinite": false, "number": 678817 }
},
"allocated": 20480
},
"weight": { "minimum": 1, "maximum": 1 },
"features": {
"total": "xeon_6346,mhz_3600",
"active": "xeon_6346,mhz_3600"
},
"gres": { "total": "", "used": "" },
"cluster": "",
"comment": "",
"extra": "",
"reason": {
"description": "IT-4461",
"time": 1705613872,
"user": "root"
},
"reservation": "",
"partition": {
"nodes": {
"allowed_allocation": "",
"configured": "cs[11,20-32,34,36,49-50,53-77,79-90,92-174,178-180,182-184,186-206,208-211,231-298,300-305]",
"total": 243
},
"accounts": { "allowed": "", "deny": "" },
"groups": { "allowed": "" },
"qos": { "allowed": "", "deny": "", "assigned": "" },
"alternate": "hw-l",
"tres": {
"billing_weights": "",
"configured": "cpu=17952,mem=271100000M,node=243,billing=17952"
},
"cluster": "",
"cpus": { "task_binding": 0, "total": 17952 },
"defaults": {
"memory_per_cpu": -9223372036854771614,
"time": { "set": false, "infinite": false, "number": 0 },
"job": ""
},
"grace_time": 0,
"maximums": {
"cpus_per_node": { "set": false, "infinite": true, "number": 0 },
"cpus_per_socket": { "set": false, "infinite": true, "number": 0 },
"memory_per_cpu": 0,
"nodes": { "set": false, "infinite": true, "number": 0 },
"shares": 1,
"time": { "set": true, "infinite": false, "number": 20160 },
"over_time_limit": { "set": false, "infinite": false, "number": 0 }
},
"minimums": { "nodes": 0 },
"name": "hw",
"node_sets": "",
"priority": { "job_factor": 1, "tier": 1 },
"timeouts": {
"resume": { "set": false, "infinite": false, "number": 0 },
"suspend": { "set": false, "infinite": false, "number": 0 }
},
"suspend_time": { "set": false, "infinite": false, "number": 0 }
}
}
],
"warnings": [],
"errors": []
}
"meta": {
"plugins": {
"data_parser": "data_parser\/v0.0.39",
"accounting_storage": "accounting_storage\/none"
},
"command": [
"sinfo",
"-N",
"--json"
],
"Slurm": {
"version": {
"major": 23,
"micro": 5,
"minor": 2
},
"release": "23.02.5"
}
},
"sinfo": [
{
"port": 6818,
"node": {
"state": [
"ALLOCATED"
]
},
"nodes": {
"allocated": 1,
"idle": 0,
"other": 0,
"total": 1,
"hostnames": [
],
"addresses": [
],
"nodes": [
"localhost"
]
},
"cpus": {
"allocated": 1,
"idle": 0,
"other": 0,
"total": 1,
"minimum": 1,
"maximum": 1,
"load": {
"minimum": 78,
"maximum": 78
},
"per_node": {
"max": {
"set": false,
"infinite": true,
"number": 0
}
}
},
"sockets": {
"minimum": 1,
"maximum": 1
},
"cores": {
"minimum": 1,
"maximum": 1
},
"threads": {
"minimum": 1,
"maximum": 1
},
"disk": {
"minimum": 0,
"maximum": 0
},
"memory": {
"minimum": 1,
"maximum": 1,
"free": {
"minimum": {
"set": true,
"infinite": false,
"number": 227
},
"maximum": {
"set": true,
"infinite": false,
"number": 227
}
},
"allocated": 1
},
"weight": {
"minimum": 1,
"maximum": 1
},
"features": {
"total": "",
"active": ""
},
"gres": {
"total": "",
"used": ""
},
"cluster": "",
"comment": "",
"extra": "",
"reason": {
"description": "",
"time": 0,
"user": ""
},
"reservation": "",
"partition": {
"nodes": {
"allowed_allocation": "",
"configured": "localhost",
"total": 1
},
"accounts": {
"allowed": "",
"deny": ""
},
"groups": {
"allowed": ""
},
"qos": {
"allowed": "",
"deny": "",
"assigned": ""
},
"alternate": "",
"tres": {
"billing_weights": "",
"configured": "cpu=1,mem=1M,node=1,billing=1"
},
"cluster": "",
"cpus": {
"task_binding": 0,
"total": 1
},
"defaults": {
"memory_per_cpu": 0,
"time": {
"set": false,
"infinite": false,
"number": 0
},
"job": ""
},
"grace_time": 0,
"maximums": {
"cpus_per_node": {
"set": false,
"infinite": true,
"number": 0
},
"cpus_per_socket": {
"set": false,
"infinite": true,
"number": 0
},
"memory_per_cpu": 0,
"nodes": {
"set": false,
"infinite": true,
"number": 0
},
"shares": 1,
"time": {
"set": false,
"infinite": true,
"number": 0
},
"over_time_limit": {
"set": false,
"infinite": false,
"number": 0
}
},
"minimums": {
"nodes": 0
},
"name": "debug",
"node_sets": "",
"priority": {
"job_factor": 1,
"tier": 1
},
"timeouts": {
"resume": {
"set": false,
"infinite": false,
"number": 0
},
"suspend": {
"set": false,
"infinite": false,
"number": 0
}
},
"suspend_time": {
"set": false,
"infinite": false,
"number": 0
}
}
}
],
"warnings": [
],
"errors": [
]
}
2 changes: 1 addition & 1 deletion exporter/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestNewConfig_Default(t *testing.T) {
assert := assert.New(t)
config, err := NewConfig(new(CliFlags))
assert.Nil(err)
assert.Equal([]string{"sinfo", "--json"}, config.cliOpts.sinfo)
assert.Equal([]string{"sinfo", "-N", "--json"}, config.cliOpts.sinfo)
assert.Equal([]string{"squeue", "--json"}, config.cliOpts.squeue)
assert.Equal([]string{"scontrol", "show", "lic", "--json"}, config.cliOpts.lic)
assert.Equal(uint64(10), config.TraceConf.rate)
Expand Down
Loading

0 comments on commit a80f8a7

Please sign in to comment.