From 3472780825ba54b1d895601a7790af043178a234 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Tue, 17 Dec 2024 14:16:24 +0100 Subject: [PATCH] debug --- pkg/metrics/metrics.jsx | 4 ++++ test/verify/check-metrics | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/metrics/metrics.jsx b/pkg/metrics/metrics.jsx index f60c4c9a2550..d1d146f3b8d2 100644 --- a/pkg/metrics/metrics.jsx +++ b/pkg/metrics/metrics.jsx @@ -1643,6 +1643,7 @@ class MetricsHistory extends React.Component { let boots = []; try { // Only 14 days of metrics are shown + console.time("journalctl_list_boots"); const output = await cockpit.spawn(["journalctl", "--list-boots", "--since", "-15d", "--output", "json"]); const list_boots = JSON.parse(output); boots = list_boots.map(boot => { @@ -1652,7 +1653,10 @@ class MetricsHistory extends React.Component { current_boot: boot?.index === 0, }; }); + console.timeEnd("journalctl_list_boots"); + console.log(JSON.stringify(boots)); } catch (exc) { + console.log("failed fetching boots", JSON.stringify(exc)); console.warn("journalctl --list-boots failed", exc); } diff --git a/test/verify/check-metrics b/test/verify/check-metrics index 83b470c5a396..f4aca5a1cad3 100755 --- a/test/verify/check-metrics +++ b/test/verify/check-metrics @@ -450,7 +450,8 @@ class TestHistoryMetrics(testlib.MachineCase): b.click("#metrics-hour-1615197600000 button.metrics-events-expander") # Show boot as event - b.wait_in_text(".metrics-minute[data-minute='35']", "Boot") + with b.wait_timeout(60): + b.wait_in_text(".metrics-minute[data-minute='35']", "Boot") # details for above load event b.click(f"{load_minute_sel} .metrics-events button.spikes_info")