From 4531a68d62199e28c5272cb76fdcab7943846078 Mon Sep 17 00:00:00 2001 From: Sascha Roloff Date: Thu, 22 May 2025 14:41:20 +0200 Subject: invocation server: add presentation of invocation wall-clock time --- doc/invocations-http-server/server.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/invocations-http-server/server.py') diff --git a/doc/invocations-http-server/server.py b/doc/invocations-http-server/server.py index 5cf06539..474fb0a4 100755 --- a/doc/invocations-http-server/server.py +++ b/doc/invocations-http-server/server.py @@ -170,6 +170,9 @@ class InvocationServer: continue full_invocations_count += 1 target = profile_data.get("target") + start_time = profile_data.get("start time") + stop_time = profile_data.get("stop time") + wall_clock_time = stop_time - start_time if (start_time is not None and stop_time is not None) else None config = core_config(profile_data.get("configuration", {})) context = meta_data.get("context", {}) remote = profile_data.get('remote', {}) @@ -185,6 +188,7 @@ class InvocationServer: "target": json.dumps(target) if target else None, "config": json.dumps(config) if config else None, "context": json.dumps(context) if context else None, + "wall_clock_time": "%5ds" % (wall_clock_time,) if wall_clock_time else None, "exit_code": profile_data.get('exit code', 0), "remote_address": remote_address, "remote_props": json.dumps(remote_props) if remote_props else None, @@ -549,6 +553,10 @@ class InvocationServer: action["name_prefix"] = "%5.1fs" % (t,) non_cached.append(action) params["non_cached"] = non_cached + start_time = profile.get("start time") + stop_time = profile.get("stop time") + wall_clock_time = stop_time - start_time if (start_time is not None and stop_time is not None) else None + params["wall_clock_time"] = "%ds" % (wall_clock_time,) if wall_clock_time else None return self.render("invocation.html", params) @@ -630,10 +638,14 @@ class InvocationServer: "data": source_data }) + start_time = profile.get("start time") + stop_time = profile.get("stop time") + wall_clock_time = stop_time - start_time if (start_time is not None and stop_time is not None) else None params["critical_artifact"] = { "name": max_name, - "path": max_path_data, + "path": max_path_data if max_path_data else None, "duration": '%0.3fs' % (max_duration,) if max_duration > 0 else None, + "wall_clock_time": "%ds" % (wall_clock_time,) if wall_clock_time else None, } return self.render("critical_path.html", params) -- cgit v1.2.3