Benchmark capture and plot
Some checks failed
CI / Test (OTP 27.2 / Elixir 1.18.2) (push) Failing after 0s
CI / Test (OTP 28.4 / Elixir 1.19.4 + Marmot E2E) (push) Failing after 0s

This commit is contained in:
2026-03-18 21:23:23 +01:00
parent 970cee2c0e
commit fc3d121599
9 changed files with 1157 additions and 43 deletions

View File

@@ -477,4 +477,35 @@ for (let i = 0; i < runs; i += 1) {
}
console.log(line);
}
// Structured JSON output for automation (bench:update pipeline)
if (process.env.BENCH_JSON_OUT) {
const jsonSummary = {};
const serverKeys = [
["parrhesia-pg", "parrhesia"],
["parrhesia-memory", "parrhesiaMemory"],
];
if (hasStrfry) serverKeys.push(["strfry", "strfry"]);
if (hasNostrRs) serverKeys.push(["nostr-rs-relay", "nostrRsRelay"]);
for (const [outputKey, summaryKey] of serverKeys) {
const s = summary[summaryKey];
jsonSummary[outputKey] = {
connect_avg_ms: s.connectAvgMs,
connect_max_ms: s.connectMaxMs,
echo_tps: s.echoTps,
echo_mibs: s.echoSizeMiBS,
event_tps: s.eventTps,
event_mibs: s.eventSizeMiBS,
req_tps: s.reqTps,
req_mibs: s.reqSizeMiBS,
};
}
fs.writeFileSync(
process.env.BENCH_JSON_OUT,
JSON.stringify(jsonSummary, null, 2) + "\n",
"utf8"
);
}
NODE