Commit 66bda5af authored by akhuziy's avatar akhuziy
Browse files

added a support to exit code status in aggregator

parent 8d6ca798
......@@ -70,6 +70,7 @@ class JobData:
requested_time = None
requested_cu = None
num_nodes = None
exit_code = None
alloc_cu = [AllocCUData()]
class NodeData:
......
......@@ -48,10 +48,10 @@ def parse_alloc_res(alloc_info):
elif nres == 2:
cu = resources[0]
node_id = resources[1]
alloc_mem[node_id] = -1
alloc_mem[node_id] = -1
else:
raise RuntimeError("Allocated resourses couldn't be parsed")
fcu = common.format_metric(metrics.metrics_node, "alloc_cu", cu)
alloc_cu[node_id] = fcu
......@@ -62,6 +62,10 @@ def format_job_info(jobinfo_init):
for name, par in metrics.metrics_job.items():
raw_value = jobinfo_init.get("last_{:s}".format(par["dbname"]), None)
if name == "exit_code" and raw_value is None:
raw_value = -1
value = common.format_metric(metrics.metrics_job, name, raw_value)
jobinfo[name] = value
......
......@@ -52,6 +52,7 @@ def get_aggregator(job_id, type="text"):
aggr.job.requested_time = jd.get("requested_time")
aggr.job.requested_cu = jd.get("requested_cu")
aggr.job.num_nodes = jd.get("num_nodes")
aggr.job.exit_code = jd.get("exit_code")
allocated_nodes = []
aggr.job.alloc_cu = []
......
......@@ -111,6 +111,9 @@ metrics_job = {
"num_nodes": {
"dbname": "num_nodes",
"type": MType.INT},
"exit_code": {
"dbname": "exit_code",
"type": MType.INT},
"alloc_cu": {
"dbname": "alloc_cu",
"type": MType.STR},
......
......@@ -14,6 +14,7 @@ class OutputSchemes:
"requested_time": "job.requested_time",
"requested_cu": "job.requested_cu",
"num_nodes": "job.num_nodes",
"exit_code": "job.exit_code",
},
"nodes": {
"type": "list",
......@@ -82,6 +83,7 @@ class OutputSchemes:
"requested_time": "job.requested_time",
"requested_cu": "job.requested_cu",
"num_nodes": "job.num_nodes",
"exit_code": "job.exit_code",
},
"nodes": {
"type": "list",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment