Files
stack/agents/darkwing/work/cohort-k1/fsync.mjs
T
jason.woltjeandClaude Opus 5.5 7478ee2c02 docs(conversation): row 46 cohort K1/K3/K10 diagnosis, receipts and candidate packet (darkwing)
The ignoreTerm tool child was TERMed before Node installed its handler
when the claim store sits on a fast disk. Candidate fixes the fixture;
the patch itself is not committed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 08:11:48 -05:00

18 lines
621 B
JavaScript

import { openSync, writeSync, fsyncSync, closeSync, rmSync, mkdtempSync } from "node:fs";
import { join } from "node:path";
for (const base of process.argv.slice(2)) {
const d = mkdtempSync(join(base, "dw-fsync-"));
const t = [];
for (let i = 0; i < 30; i++) {
const s = performance.now();
const fd = openSync(join(d, `f${i}`), "w");
writeSync(fd, "x".repeat(512));
fsyncSync(fd);
closeSync(fd);
t.push(performance.now() - s);
}
rmSync(d, { recursive: true });
t.sort((a, b) => a - b);
console.log(`${base}: write+fsync median ${t[15].toFixed(2)} ms, p90 ${t[27].toFixed(2)} ms`);
}