Skip to content

Commit 8f45eb9

Browse files
committed
fix(containers): address review feedback on Stats tab
- I1: cancel child process on timeout using AbortController; guard polls with inFlight flag so concurrent calls cannot stack up - I2: clean up session when renderer WebContents is destroyed (handles hard reloads / crashes that bypass onBeforeUnmount) - I3: emit container-stats/stopped to renderer before clearing sessions in stopAll so the tab does not freeze on last sample after engine change - I4: call resetBuffers on every isContainerRunning transition so prior-run samples do not bleed into a new container lifecycle - I5: gate Stats tab on Moby engine; show informational banner otherwise - S1: divide NetIO / BlockIO deltas by refreshSeconds to plot bytes/s rate - S2: waitForCharts also waits for a process-table row (proves data arrived) - S3: replace whitespace-split tokenizer with column-position parser so multi-word header fields (e.g. START TIME) are handled correctly - S4: parsePair is explicit when no separator is present - S5: reset prevNet*/prevBlock* in restartPolling to avoid spike on rate change - S6: log non-JSON docker stats output instead of silently discarding it - S7: track memory limit as a second dashed dataset for context - S8: use exact version pins for chart.js and vue-chartjs (match project convention) - S10: read chart palette from CSS custom properties with hardcoded fallbacks - S11: make process-table and refresh-select e2e tests navigate independently - S12: extract sendToFrame into shared main/ipcUtils.ts; use in both containerStats.ts and containerExec.ts Signed-off-by: Gildas Le Nadan <3ntr0p13+github@gmail.com>
1 parent 4a2a9b7 commit 8f45eb9

9 files changed

Lines changed: 215 additions & 113 deletions

File tree

e2e/containers.e2e.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,12 +605,14 @@ test.describe.serial('Container Stats Tab', () => {
605605
});
606606

607607
test('process table shows at least one row', async() => {
608-
const statsPage = new ContainerStatsPage(page);
608+
const statsPage = await navigateToStatsTab(runningContainerId);
609609
await expect(statsPage.processTable.locator('tbody tr').first()).toBeVisible({ timeout: 15_000 });
610610
});
611611

612612
test('refresh rate select has the correct options', async() => {
613-
const statsPage = new ContainerStatsPage(page);
613+
const statsPage = await navigateToStatsTab(runningContainerId);
614+
615+
await expect(statsPage.refreshSelect).toBeVisible({ timeout: 15_000 });
614616
const options = await statsPage.refreshSelect.locator('option').allTextContents();
615617

616618
expect(options).toEqual(['1 s', '5 s', '10 s', '20 s', '30 s', '1 min']);

e2e/pages/container-stats-page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@ export class ContainerStatsPage {
3434
await expect(this.memoryChart).toBeVisible({ timeout });
3535
await expect(this.networkChart).toBeVisible({ timeout });
3636
await expect(this.ioChart).toBeVisible({ timeout });
37+
// Wait for at least one poll cycle to complete (process table row proves data arrived).
38+
await expect(this.processTable.locator('tbody tr').first()).toBeVisible({ timeout });
3739
}
3840
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@xterm/addon-web-links": "0.12.0",
6464
"@xterm/xterm": "6.0.0",
6565
"async-mutex": "^0.5.0",
66-
"chart.js": "^4.4.9",
66+
"chart.js": "4.5.1",
6767
"cookie-universal": "2.2.2",
6868
"cross-spawn": "7.0.6",
6969
"dayjs": "1.11.20",
@@ -86,7 +86,7 @@
8686
"tar-stream": "3.2.0",
8787
"vue": "3.5.34",
8888
"vue-3-slider-component": "1.0.2",
89-
"vue-chartjs": "^5.3.2",
89+
"vue-chartjs": "5.3.3",
9090
"vue-router": "5.0.7",
9191
"vue-select": "3.20.4",
9292
"vuex": "4.1.0",

0 commit comments

Comments
 (0)