Skip to content
Snippets Groups Projects
Commit b8802cc4 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -376,6 +376,8 @@ class _QueuedJob(object): ...@@ -376,6 +376,8 @@ class _QueuedJob(object):
row.append(self.id) row.append(self.id)
elif fname == "status": elif fname == "status":
row.append(self.CalcStatus()) row.append(self.CalcStatus())
elif fname == "priority":
row.append(self.CalcPriority())
elif fname == "ops": elif fname == "ops":
row.append([op.input.__getstate__() for op in self.ops]) row.append([op.input.__getstate__() for op in self.ops])
elif fname == "opresult": elif fname == "opresult":
...@@ -390,6 +392,8 @@ class _QueuedJob(object): ...@@ -390,6 +392,8 @@ class _QueuedJob(object):
row.append([op.exec_timestamp for op in self.ops]) row.append([op.exec_timestamp for op in self.ops])
elif fname == "opend": elif fname == "opend":
row.append([op.end_timestamp for op in self.ops]) 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": elif fname == "received_ts":
row.append(self.received_timestamp) row.append(self.received_timestamp)
elif fname == "start_ts": elif fname == "start_ts":
......
...@@ -159,6 +159,12 @@ ...@@ -159,6 +159,12 @@
<simpara>the status of the job</simpara> <simpara>the status of the job</simpara>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>priority</term>
<listitem>
<simpara>current priority of the job</simpara>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term>received_ts</term> <term>received_ts</term>
<listitem> <listitem>
...@@ -227,6 +233,12 @@ ...@@ -227,6 +233,12 @@
<simpara>the list of opcode end times</simpara> <simpara>the list of opcode end times</simpara>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>oppriority</term>
<listitem>
<simpara>the priority of each opcode</simpara>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
......
...@@ -69,6 +69,7 @@ def ListJobs(opts, args): ...@@ -69,6 +69,7 @@ def ListJobs(opts, args):
headers = { headers = {
"id": "ID", "id": "ID",
"status": "Status", "status": "Status",
"priority": "Prio",
"ops": "OpCodes", "ops": "OpCodes",
"opresult": "OpCode_result", "opresult": "OpCode_result",
"opstatus": "OpCode_status", "opstatus": "OpCode_status",
...@@ -77,6 +78,7 @@ def ListJobs(opts, args): ...@@ -77,6 +78,7 @@ def ListJobs(opts, args):
"opstart": "OpCode_start", "opstart": "OpCode_start",
"opexec": "OpCode_exec", "opexec": "OpCode_exec",
"opend": "OpCode_end", "opend": "OpCode_end",
"oppriority": "OpCode_prio",
"start_ts": "Start", "start_ts": "Start",
"end_ts": "End", "end_ts": "End",
"received_ts": "Received", "received_ts": "Received",
...@@ -84,6 +86,8 @@ def ListJobs(opts, args): ...@@ -84,6 +86,8 @@ def ListJobs(opts, args):
else: else:
headers = None headers = None
numfields = ["priority"]
# change raw values to nicer strings # change raw values to nicer strings
for row_id, row in enumerate(output): for row_id, row in enumerate(output):
if row is None: if row is None:
...@@ -107,7 +111,8 @@ def ListJobs(opts, args): ...@@ -107,7 +111,8 @@ def ListJobs(opts, args):
row[idx] = str(val) row[idx] = str(val)
data = GenerateTable(separator=opts.separator, headers=headers, data = GenerateTable(separator=opts.separator, headers=headers,
fields=selected_fields, data=output) fields=selected_fields, data=output,
numfields=numfields)
for line in data: for line in data:
ToStdout(line) ToStdout(line)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment