Skip to content

Commit 8002c24

Browse files
committed
Bump version to 1.29.0
2 parents d189541 + 6555539 commit 8002c24

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGELOG
22
`````````
33

4+
Version 1.29.0 -- 2023-06-12
5+
----------------------------
6+
7+
- Litani now measures the runtime of each job in fractional seconds and
8+
records this information in the "duration_ms" field in run.json.
9+
10+
411
Version 1.28.0 -- 2023-03-02
512
----------------------------
613
This is a bugfix release containing the following fix:

lib/exec.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import __main__
1515

16+
import datetime
1617
import json
1718
import logging
1819
import os
@@ -96,6 +97,7 @@ async def exec_job(args):
9697
"wrapper_arguments": args_dict,
9798
"complete": False,
9899
}
100+
start_time = datetime.datetime.now(datetime.timezone.utc)
99101
lib.util.timestamp("start_time", out_data)
100102
with litani.atomic_write(args.status_file) as handle:
101103
print(json.dumps(out_data, indent=2), file=handle)
@@ -105,6 +107,7 @@ async def exec_job(args):
105107
args.timeout, args.profile_memory, args.profile_memory_interval,
106108
args_dict["job_id"])
107109
await run()
110+
end_time = datetime.datetime.now(datetime.timezone.utc)
108111
lib.job_outcome.fill_in_result(run, out_data, args)
109112

110113
for out_field, proc_pipe, arg_file in [
@@ -127,6 +130,11 @@ async def exec_job(args):
127130
file=sys.stderr)
128131

129132
lib.util.timestamp("end_time", out_data)
133+
134+
duration = end_time - start_time
135+
dur_sec = duration.seconds + (duration.days * 60 * 60 * 24)
136+
out_data["duration_ms"] = f"{dur_sec}.{duration.microseconds}"
137+
130138
out_str = json.dumps(out_data, indent=2)
131139
logging.debug("run status: %s", out_str)
132140
with litani.atomic_write(args.status_file) as handle:

lib/litani.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
TIME_FORMAT_W = "%Y-%m-%dT%H:%M:%SZ"
3434
TIME_FORMAT_MS = "%Y-%m-%dT%H:%M:%S.%fZ"
3535
VERSION_MAJOR = 1
36-
VERSION_MINOR = 28
36+
VERSION_MINOR = 29
3737
VERSION_PATCH = 0
3838
RC = False
3939

lib/validation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ def _run_schema():
392392
"stdout": voluptuous.Any([str], None),
393393
# A list of strings that the command printed to its stdout.
394394

395+
"duration_ms": voluptuous.Any(str, None),
396+
# Duration of this job S.MS
397+
395398
"duration_str": voluptuous.Any(str, None),
396399
# A human-readable duration of this job (HH:MM:SS).
397400

0 commit comments

Comments
 (0)