Skip to content

Commit

Permalink
Bump version to 1.29.0
Browse files Browse the repository at this point in the history
  • Loading branch information
karkhaz committed Jun 12, 2023
2 parents d189541 + 6555539 commit 8002c24
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGELOG
`````````

Version 1.29.0 -- 2023-06-12
----------------------------

- Litani now measures the runtime of each job in fractional seconds and
records this information in the "duration_ms" field in run.json.


Version 1.28.0 -- 2023-03-02
----------------------------
This is a bugfix release containing the following fix:
Expand Down
8 changes: 8 additions & 0 deletions lib/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import __main__

import datetime
import json
import logging
import os
Expand Down Expand Up @@ -96,6 +97,7 @@ async def exec_job(args):
"wrapper_arguments": args_dict,
"complete": False,
}
start_time = datetime.datetime.now(datetime.timezone.utc)
lib.util.timestamp("start_time", out_data)
with litani.atomic_write(args.status_file) as handle:
print(json.dumps(out_data, indent=2), file=handle)
Expand All @@ -105,6 +107,7 @@ async def exec_job(args):
args.timeout, args.profile_memory, args.profile_memory_interval,
args_dict["job_id"])
await run()
end_time = datetime.datetime.now(datetime.timezone.utc)
lib.job_outcome.fill_in_result(run, out_data, args)

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

lib.util.timestamp("end_time", out_data)

duration = end_time - start_time
dur_sec = duration.seconds + (duration.days * 60 * 60 * 24)
out_data["duration_ms"] = f"{dur_sec}.{duration.microseconds}"

out_str = json.dumps(out_data, indent=2)
logging.debug("run status: %s", out_str)
with litani.atomic_write(args.status_file) as handle:
Expand Down
2 changes: 1 addition & 1 deletion lib/litani.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
TIME_FORMAT_W = "%Y-%m-%dT%H:%M:%SZ"
TIME_FORMAT_MS = "%Y-%m-%dT%H:%M:%S.%fZ"
VERSION_MAJOR = 1
VERSION_MINOR = 28
VERSION_MINOR = 29
VERSION_PATCH = 0
RC = False

Expand Down
3 changes: 3 additions & 0 deletions lib/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ def _run_schema():
"stdout": voluptuous.Any([str], None),
# A list of strings that the command printed to its stdout.

"duration_ms": voluptuous.Any(str, None),
# Duration of this job S.MS

"duration_str": voluptuous.Any(str, None),
# A human-readable duration of this job (HH:MM:SS).

Expand Down

0 comments on commit 8002c24

Please sign in to comment.