Commit b8802cc4 authored by Michael Hanselmann's avatar Michael Hanselmann

jqueue/gnt-job: Add job priority fields for display

These fields can help with debugging.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 900df6cd
......@@ -376,6 +376,8 @@ class _QueuedJob(object):
row.append(self.id)
elif fname == "status":
row.append(self.CalcStatus())
elif fname == "priority":
row.append(self.CalcPriority())
elif fname == "ops":
row.append([op.input.__getstate__() for op in self.ops])
elif fname == "opresult":
......@@ -390,6 +392,8 @@ class _QueuedJob(object):
row.append([op.exec_timestamp for op in self.ops])
elif fname == "opend":
row.append([op.end_timestamp for op in self.ops])
elif fname == "oppriority":
row.append([op.priority for op in self.ops])
elif fname == "received_ts":
row.append(self.received_timestamp)
elif fname == "start_ts":
......
......@@ -159,6 +159,12 @@
<simpara>the status of the job</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>priority</term>
<listitem>
<simpara>current priority of the job</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>received_ts</term>
<listitem>
......@@ -227,6 +233,12 @@
<simpara>the list of opcode end times</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>oppriority</term>
<listitem>
<simpara>the priority of each opcode</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
......
......@@ -69,6 +69,7 @@ def ListJobs(opts, args):
headers = {
"id": "ID",
"status": "Status",
"priority": "Prio",
"ops": "OpCodes",
"opresult": "OpCode_result",
"opstatus": "OpCode_status",
......@@ -77,6 +78,7 @@ def ListJobs(opts, args):
"opstart": "OpCode_start",
"opexec": "OpCode_exec",
"opend": "OpCode_end",
"oppriority": "OpCode_prio",
"start_ts": "Start",
"end_ts": "End",
"received_ts": "Received",
......@@ -84,6 +86,8 @@ def ListJobs(opts, args):
else:
headers = None
numfields = ["priority"]
# change raw values to nicer strings
for row_id, row in enumerate(output):
if row is None:
......@@ -107,7 +111,8 @@ def ListJobs(opts, args):
row[idx] = str(val)
data = GenerateTable(separator=opts.separator, headers=headers,
fields=selected_fields, data=output)
fields=selected_fields, data=output,
numfields=numfields)
for line in data:
ToStdout(line)
......
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