Broken Docker containers are alerts
From Dockhand, on the health pass: a container that keeps restarting (critical, with its exit code), one whose own health check fails, one that stopped unexpectedly, one created and never started for an hour, and a Docker host Dockhand cannot reach. A stop is only news when it was seen happen, so stacks switched off long ago stay quiet. A Leave alone button on the Docker page and a list in Settings; on by default. Also fixes a date-dependent storage-forecast test that pinned its clock while the code under test reads the real one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
16b24f5436
commit
0fa50c2d5a
20 files changed
+659
-17
No files matched your search
@@ -234,17 +234,19 @@ describe("rules, the Alerts page and the pages that show them", () => {
|
||||
});
|
||||
|
||||
test("a pool on a steady climb is forecast; a flat one, a wobbly one and one already over the limit are not", async () => {
|
||||
// This one is judged on the Alerts page and by the routes, which read the real clock (a pool not reported for two days is not believed), so its history is laid out from the real now.
|
||||
const T = Date.now();
|
||||
const [pve] = await db.select().from(integrations).where(eq(integrations.type, "proxmox"));
|
||||
const make = async (key: string, label: string, valueAt: (day: number) => number, latest: number) => {
|
||||
const [s] = await db.insert(storageSeries).values({ integrationId: pve.id, key, label, latestPercent: latest, usedBytes: null, totalBytes: null, updatedAt: new Date(NOW).toISOString() }).returning();
|
||||
for (let d = 0; d <= 14; d += 0.5) await db.insert(storageSamples).values({ seriesId: s.id, at: new Date(NOW - (14 - d) * DAY).toISOString(), value: valueAt(d) });
|
||||
const [s] = await db.insert(storageSeries).values({ integrationId: pve.id, key, label, latestPercent: latest, usedBytes: null, totalBytes: null, updatedAt: new Date(T).toISOString() }).returning();
|
||||
for (let d = 0; d <= 14; d += 0.5) await db.insert(storageSamples).values({ seriesId: s.id, at: new Date(T - (14 - d) * DAY).toISOString(), value: valueAt(d) });
|
||||
return s;
|
||||
};
|
||||
const climbing = await make("a:climb", "PVE / a: storage \"climb\"", (d) => 50 + d * 2.5, 85);
|
||||
await make("b:flat", "PVE / b: storage \"flat\"", () => 40, 40);
|
||||
await make("c:wobble", "PVE / c: storage \"wobble\"", (d) => 50 + (Math.floor(d * 2) % 2 === 0 ? 8 : -8), 58);
|
||||
await make("d:over", "PVE / d: storage \"over\"", (d) => 80 + d * 0.9, 92.6);
|
||||
const rows = await storageOverview(new Date(NOW));
|
||||
const rows = await storageOverview(new Date(T));
|
||||
const by = Object.fromEntries(rows.map((r) => [r.key, r]));
|
||||
assert.equal(by["a:climb"].steady, true);
|
||||
assert.equal(by["b:flat"].trend?.daysToFull ?? null, null);
|
||||
|
||||
Reference in new issue
Block a user