Revision b9b5abcb
b/lib/jqueue.py | ||
---|---|---|
77 | 77 |
@ivar status: the current status |
78 | 78 |
@ivar result: the result of the LU execution |
79 | 79 |
@ivar start_timestamp: timestamp for the start of the execution |
80 |
@ivar exec_timestamp: timestamp for the actual LU Exec() function invocation |
|
80 | 81 |
@ivar stop_timestamp: timestamp for the end of the execution |
81 | 82 |
|
82 | 83 |
""" |
83 | 84 |
__slots__ = ["input", "status", "result", "log", |
84 |
"start_timestamp", "end_timestamp", |
|
85 |
"start_timestamp", "exec_timestamp", "end_timestamp",
|
|
85 | 86 |
"__weakref__"] |
86 | 87 |
|
87 | 88 |
def __init__(self, op): |
... | ... | |
96 | 97 |
self.result = None |
97 | 98 |
self.log = [] |
98 | 99 |
self.start_timestamp = None |
100 |
self.exec_timestamp = None |
|
99 | 101 |
self.end_timestamp = None |
100 | 102 |
|
101 | 103 |
@classmethod |
... | ... | |
114 | 116 |
obj.result = state["result"] |
115 | 117 |
obj.log = state["log"] |
116 | 118 |
obj.start_timestamp = state.get("start_timestamp", None) |
119 |
obj.exec_timestamp = state.get("exec_timestamp", None) |
|
117 | 120 |
obj.end_timestamp = state.get("end_timestamp", None) |
118 | 121 |
return obj |
119 | 122 |
|
... | ... | |
130 | 133 |
"result": self.result, |
131 | 134 |
"log": self.log, |
132 | 135 |
"start_timestamp": self.start_timestamp, |
136 |
"exec_timestamp": self.exec_timestamp, |
|
133 | 137 |
"end_timestamp": self.end_timestamp, |
134 | 138 |
} |
135 | 139 |
|
... | ... | |
385 | 389 |
raise CancelJob() |
386 | 390 |
|
387 | 391 |
self._op.status = constants.OP_STATUS_RUNNING |
392 |
self._op.exec_timestamp = TimeStampNow() |
|
388 | 393 |
finally: |
389 | 394 |
self._queue.release() |
390 | 395 |
|
... | ... | |
1383 | 1388 |
row.append([op.log for op in job.ops]) |
1384 | 1389 |
elif fname == "opstart": |
1385 | 1390 |
row.append([op.start_timestamp for op in job.ops]) |
1391 |
elif fname == "opexec": |
|
1392 |
row.append([op.exec_timestamp for op in job.ops]) |
|
1386 | 1393 |
elif fname == "opend": |
1387 | 1394 |
row.append([op.end_timestamp for op in job.ops]) |
1388 | 1395 |
elif fname == "received_ts": |
b/man/gnt-job.sgml | ||
---|---|---|
210 | 210 |
<varlistentry> |
211 | 211 |
<term>opstart</term> |
212 | 212 |
<listitem> |
213 |
<simpara>the list of opcode start times</simpara> |
|
213 |
<simpara>the list of opcode start times (before |
|
214 |
acquiring locks)</simpara> |
|
215 |
</listitem> |
|
216 |
</varlistentry> |
|
217 |
<varlistentry> |
|
218 |
<term>opexec</term> |
|
219 |
<listitem> |
|
220 |
<simpara>the list of opcode execution start times (after |
|
221 |
acquiring any necessary locks)</simpara> |
|
214 | 222 |
</listitem> |
215 | 223 |
</varlistentry> |
216 | 224 |
<varlistentry> |
b/scripts/gnt-job | ||
---|---|---|
80 | 80 |
"oplog": "OpCode_log", |
81 | 81 |
"summary": "Summary", |
82 | 82 |
"opstart": "OpCode_start", |
83 |
"opexec": "OpCode_exec", |
|
83 | 84 |
"opend": "OpCode_end", |
84 | 85 |
"start_ts": "Start", |
85 | 86 |
"end_ts": "End", |
... | ... | |
106 | 107 |
val = ",".join(val) |
107 | 108 |
elif field in ("start_ts", "end_ts", "received_ts"): |
108 | 109 |
val = FormatTimestamp(val) |
109 |
elif field in ("opstart", "opend"): |
|
110 |
elif field in ("opstart", "opexec", "opend"):
|
|
110 | 111 |
val = [FormatTimestamp(entry) for entry in val] |
111 | 112 |
elif field == "lock_status" and not val: |
112 | 113 |
val = "-" |
... | ... | |
212 | 213 |
|
213 | 214 |
selected_fields = [ |
214 | 215 |
"id", "status", "ops", "opresult", "opstatus", "oplog", |
215 |
"opstart", "opend", "received_ts", "start_ts", "end_ts", |
|
216 |
"opstart", "opexec", "opend", "received_ts", "start_ts", "end_ts",
|
|
216 | 217 |
] |
217 | 218 |
|
218 | 219 |
result = GetClient().QueryJobs(args, selected_fields) |
... | ... | |
235 | 236 |
continue |
236 | 237 |
|
237 | 238 |
(job_id, status, ops, opresult, opstatus, oplog, |
238 |
opstart, opend, recv_ts, start_ts, end_ts) = entry |
|
239 |
opstart, opexec, opend, recv_ts, start_ts, end_ts) = entry
|
|
239 | 240 |
format(0, "Job ID: %s" % job_id) |
240 | 241 |
if status in _USER_JOB_STATUS: |
241 | 242 |
status = _USER_JOB_STATUS[status] |
... | ... | |
275 | 276 |
else: |
276 | 277 |
format(1, "Total processing time: N/A") |
277 | 278 |
format(1, "Opcodes:") |
278 |
for (opcode, result, status, log, s_ts, e_ts) in \ |
|
279 |
zip(ops, opresult, opstatus, oplog, opstart, opend): |
|
279 |
for (opcode, result, status, log, s_ts, x_ts, e_ts) in \
|
|
280 |
zip(ops, opresult, opstatus, oplog, opstart, opexec, opend):
|
|
280 | 281 |
format(2, "%s" % opcode["OP_ID"]) |
281 | 282 |
format(3, "Status: %s" % status) |
282 | 283 |
if isinstance(s_ts, (tuple, list)): |
283 | 284 |
format(3, "Processing start: %s" % FormatTimestamp(s_ts)) |
284 | 285 |
else: |
285 | 286 |
format(3, "No processing start time") |
287 |
if isinstance(x_ts, (tuple, list)): |
|
288 |
format(3, "Execution start: %s" % FormatTimestamp(x_ts)) |
|
289 |
else: |
|
290 |
format(3, "No execution start time") |
|
286 | 291 |
if isinstance(e_ts, (tuple, list)): |
287 | 292 |
format(3, "Processing end: %s" % FormatTimestamp(e_ts)) |
288 | 293 |
else: |
Also available in: Unified diff