Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly committed Dec 17, 2024
1 parent 8aa32a3 commit 3472780
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/metrics/metrics.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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);
}

Expand Down
3 changes: 2 additions & 1 deletion test/verify/check-metrics
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3472780

Please sign in to comment.