Commit 1d2dcdfd authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Export new lock_status field to gnt-job


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent ef2df7d3
......@@ -1395,6 +1395,8 @@ class JobQueue(object):
row.append(job.start_timestamp)
elif fname == "end_ts":
row.append(job.end_timestamp)
elif fname == "lock_status":
row.append(job.lock_status)
elif fname == "summary":
row.append([op.input.Summary() for op in job.ops])
else:
......
......@@ -219,6 +219,18 @@
<simpara>the list of opcode end times</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>lock_status</term>
<listitem>
<simpara>the lock status (useful for debugging) formatted as
<quote>[waiting|acquiring]/[locklevel]/[lockname]/[shared|exclusive]</quote>.
Locklevel describes the type of lock (either
<quote>instance</quote>, <quote>node</quote> or
<quote>cluster</quote>). Lockname is a list of names or
<quote>ALL</quote> to describe all entities of the lock type.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
......
......@@ -81,6 +81,7 @@ def ListJobs(opts, args):
"start_ts": "Start",
"end_ts": "End",
"received_ts": "Received",
"lock_status": "LockStatus",
}
else:
headers = None
......@@ -104,6 +105,8 @@ def ListJobs(opts, args):
val = FormatTimestamp(val)
elif field in ("opstart", "opend"):
val = [FormatTimestamp(entry) for entry in val]
elif field == "lock_status" and not val:
val = "-"
row[idx] = str(val)
......
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