monitoring(testing): collapse heavy drilldowns

This commit is contained in:
jenkins 2026-04-22 16:56:52 -03:00
parent 88d2225774
commit 47b31ebcf4
6 changed files with 10313 additions and 9925 deletions

View File

@ -1322,6 +1322,18 @@ def text_panel(panel_id, title, content, grid):
}
def row_panel(panel_id, title, y, *, collapsed=True, panels=None):
"""Return a Grafana row, optionally carrying collapsed child panels."""
return {
"id": panel_id,
"type": "row",
"title": title,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": y},
"collapsed": collapsed,
**({"panels": panels or []} if collapsed else {}),
}
DASHBOARD_LINK_TITLES = {
"atlas-overview": "Open Atlas Overview",
"atlas-pods": "Open Atlas Pods",
@ -3821,6 +3833,63 @@ def build_jobs_dashboard():
)
)
# Keep the first paint intentionally light. The detailed matrices remain
# available, but they stay collapsed so browsers do not render every series
# and legend before the operator asks for them.
panel_by_id = {panel["id"]: panel for panel in panels}
visible_layout = {
2: {"h": 4, "w": 4, "x": 0, "y": 0},
3: {"h": 4, "w": 4, "x": 4, "y": 0},
4: {"h": 4, "w": 4, "x": 8, "y": 0},
5: {"h": 4, "w": 4, "x": 12, "y": 0},
6: {"h": 4, "w": 4, "x": 16, "y": 0},
7: {"h": 4, "w": 4, "x": 20, "y": 0},
8: {"h": 7, "w": 8, "x": 0, "y": 4},
9: {"h": 7, "w": 8, "x": 8, "y": 4},
10: {"h": 7, "w": 8, "x": 16, "y": 4},
17: {"h": 7, "w": 12, "x": 0, "y": 11},
18: {"h": 7, "w": 12, "x": 12, "y": 11},
}
compact_panels = []
for panel_id, grid in visible_layout.items():
panel = panel_by_id[panel_id]
panel["gridPos"] = grid
compact_panels.append(panel)
def children(ids):
return [panel_by_id[panel_id] for panel_id in ids]
compact_panels.extend(
[
row_panel(500, "Reliability And Run History", 18, panels=children([11, 12, 13, 14])),
row_panel(
501,
"Failure Trends By Check",
19,
panels=children([130, 131, 132, 133, 134, 135, 136]),
),
row_panel(
502,
"Success Trends By Check",
20,
panels=children([138, 139, 140, 141, 142, 143, 144]),
),
row_panel(
503,
"Test Drilldowns And Problem Tests",
21,
panels=children([145, 147, 146, 152]),
),
row_panel(
504,
"Telemetry Completeness, SonarQube, And Branches",
22,
panels=children([27, 28, 29, 30, 31, 32, 33, 34, 35, 148, 151, 149, 150]),
),
]
)
panels = compact_panels
return {
"uid": "atlas-jobs",
"title": "Atlas Testing",

View File

@ -11,6 +11,14 @@ def load_module():
return module
def flatten_panels(panels):
flat = []
for panel in panels:
flat.append(panel)
flat.extend(panel.get("panels", []))
return flat
def test_table_panel_options_and_filterable():
mod = load_module()
panel = mod.table_panel(
@ -73,7 +81,7 @@ def test_testing_suite_variable_uses_canonical_values_only():
def test_jobs_dashboard_separates_current_gate_health_from_reliability():
mod = load_module()
dashboard = mod.build_jobs_dashboard()
panels_by_title = {panel["title"]: panel for panel in dashboard["panels"]}
panels_by_title = {panel["title"]: panel for panel in flatten_panels(dashboard["panels"])}
assert "Current Gate Health by Suite" in panels_by_title
assert "Run Reliability by Suite (24h)" in panels_by_title
@ -93,3 +101,34 @@ def test_jobs_dashboard_separates_current_gate_health_from_reliability():
assert reliability_panel["fieldConfig"]["defaults"]["mappings"] == [
{"type": "value", "options": {"-1": {"text": "no runs"}}}
]
def test_jobs_dashboard_collapses_heavy_drilldowns_for_light_first_paint():
mod = load_module()
dashboard = mod.build_jobs_dashboard()
panels = dashboard["panels"]
rows = [panel for panel in panels if panel["type"] == "row"]
visible_query_panels = [panel for panel in panels if panel["type"] != "row"]
nested_panels_by_title = {
child["title"]: child
for row in rows
for child in row.get("panels", [])
}
assert len(panels) == 16
assert len(visible_query_panels) == 11
assert sum(len(panel.get("targets", [])) for panel in visible_query_panels) == 11
assert [row["title"] for row in rows] == [
"Reliability And Run History",
"Failure Trends By Check",
"Success Trends By Check",
"Test Drilldowns And Problem Tests",
"Telemetry Completeness, SonarQube, And Branches",
]
assert all(row["collapsed"] for row in rows)
assert "Failure Trend: Coverage" in nested_panels_by_title
assert "Success Trend: Supply Chain" in nested_panels_by_title
assert "Selected Test Pass Rate History" in nested_panels_by_title
assert "Missing Coverage Metrics by Suite" in nested_panels_by_title
assert "SonarQube API Up" in nested_panels_by_title

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff