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 +++++++++++++- doc/invocations-http-server/templates/critical_path.html | 11 ++++++++++- doc/invocations-http-server/templates/invocation.html | 3 +++ doc/invocations-http-server/templates/invocations.html | 3 +++ 4 files changed, 29 insertions(+), 2 deletions(-) (limited to 'doc/invocations-http-server') 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) diff --git a/doc/invocations-http-server/templates/critical_path.html b/doc/invocations-http-server/templates/critical_path.html index 8d818809..e345b50b 100644 --- a/doc/invocations-http-server/templates/critical_path.html +++ b/doc/invocations-http-server/templates/critical_path.html @@ -11,8 +11,16 @@ Invocations {{invocation | e}}

Overview

{% endblock %} diff --git a/doc/invocations-http-server/templates/invocation.html b/doc/invocations-http-server/templates/invocation.html index 6ccb0a56..6babb751 100644 --- a/doc/invocations-http-server/templates/invocation.html +++ b/doc/invocations-http-server/templates/invocation.html @@ -75,6 +75,9 @@ Invocation {{invocation | e}} {% else %}
  • Context: (none)
  • {% endif %} + {% if wall_clock_time %} +
  • Wall-clock time: {{ wall_clock_time | e }}
  • + {% endif %} {% if exit_code != None %}
  • Exit code: {{ exit_code | e }}
  • {% endif %} diff --git a/doc/invocations-http-server/templates/invocations.html b/doc/invocations-http-server/templates/invocations.html index 607b9a7a..b5ef5433 100644 --- a/doc/invocations-http-server/templates/invocations.html +++ b/doc/invocations-http-server/templates/invocations.html @@ -72,6 +72,9 @@ Filter by: {% if invocation.target %} {{ invocation.target | e}} {% endif %} + {% if invocation.wall_clock_time %} + {{ invocation.wall_clock_time | e}} + {% endif %} {% if invocation.exit_code != 0 %} {% if invocation.exit_code == 1 %} -- cgit v1.2.3