(report: ClusterReport)
| 71 | |
| 72 | |
| 73 | def create_page(report: ClusterReport): |
| 74 | structure = [] |
| 75 | per_node_df = create_global_resources_df(report.monitoring) |
| 76 | |
| 77 | if not per_node_df.empty: |
| 78 | structure += [ |
| 79 | ( |
| 80 | "Global utilization", |
| 81 | lambda r: render_global_resource_usage(r, per_node_df), |
| 82 | ) |
| 83 | ] |
| 84 | |
| 85 | if not per_node_df.empty: |
| 86 | structure += [("Node utilization", lambda r: render_nodes_resource_usage(r, per_node_df))] |
| 87 | |
| 88 | per_process_df = create_per_process_resources_df(report.monitoring) |
| 89 | if not per_process_df.empty: |
| 90 | structure += [ |
| 91 | ( |
| 92 | "Process utilization", |
| 93 | lambda r: render_process_resource_usage(r, per_process_df), |
| 94 | ) |
| 95 | ] |
| 96 | |
| 97 | structure.append(("Output", render_output)) |
| 98 | |
| 99 | if report.profiling_data: |
| 100 | structure.append(("Profiler", render_profiling_data)) |
| 101 | |
| 102 | tabs = [] |
| 103 | for name, fn in structure: |
| 104 | widget = fn(report) |
| 105 | if widget is not None: |
| 106 | tabs.append(Panel(child=widget, title=name)) |
| 107 | |
| 108 | return Tabs(tabs=tabs) |
| 109 | |
| 110 | |
| 111 | @dataclasses.dataclass |
no test coverage detected