diff options
author | Sascha Roloff <sascha.roloff@huawei.com> | 2025-05-22 14:41:20 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2025-05-22 14:41:20 +0200 |
commit | 4531a68d62199e28c5272cb76fdcab7943846078 (patch) | |
tree | b6c5dcdf9b0e738cd62298d1f9cd2464e4baf68c /doc | |
parent | e8501865cf7bff5cf7d505b595ccd66ddbd625f7 (diff) | |
download | justbuild-4531a68d62199e28c5272cb76fdcab7943846078.tar.gz |
invocation server: add presentation of invocation wall-clock time
Diffstat (limited to 'doc')
4 files changed, 29 insertions, 2 deletions
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}} <h2>Overview</h2> <ul> <li>Invocation: <a href="/invocations/{{ invocation | e }}"><tt>{{ invocation | e }}</tt></a></li> + {% if critical_artifact["wall_clock_time"] %} + <li>Wall-clock time: <tt>{{ critical_artifact["wall_clock_time"] | e }}</tt></li> + {% endif %} + {% if critical_artifact["duration"] %} + <li>Length of critical path: <tt>{{ critical_artifact["duration"] | e }}</tt></li> + {% endif %} + {% if critical_artifact["name"] %} <li>Critical artifact: <tt>{{ critical_artifact["name"] | e }}</tt></li> - <li>Duration: <tt>{{ critical_artifact["duration"] | e }}</tt></li> + {% endif %} + {% if critical_artifact["path"] %} <li>Path:</li> <ul> {% for entry in critical_artifact["path"] %} @@ -23,5 +31,6 @@ Invocations {{invocation | e}} {% endif %} {% endfor %} </ul> + {% endif %} </ul> {% 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 %} <li> Context: <i>(none)</i></li> {% endif %} + {% if wall_clock_time %} + <li> Wall-clock time: <tt>{{ wall_clock_time | e }}</tt></li> + {% endif %} {% if exit_code != None %} <li> Exit code: <tt>{{ exit_code | e }}</tt></li> {% 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 %} <span id="invocation-target"><tt>{{ invocation.target | e}}</tt></span> {% endif %} + {% if invocation.wall_clock_time %} + <tt>{{ invocation.wall_clock_time | e}}</tt> + {% endif %} {% if invocation.exit_code != 0 %} <span id="invocation-failure"><b> {% if invocation.exit_code == 1 %} |