fix(bench): reuse hello median for secure-cost parity row (consistent numbers)

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-07-06 22:57:22 -05:00
1 parent 32b0087650
commit 926ca3901c
1 file changed
+6 -4
+6 -4
View File
@@ -120,10 +120,12 @@ async function main(): Promise<void> {
const runs = await measure(port, sr.path, 'GET'); const runs = await measure(port, sr.path, 'GET');
stepScaling.push({ path: sr.path, steps: sr.steps, reqSec: aggregate(runs.map((r) => r.reqSec)).median }); stepScaling.push({ path: sr.path, steps: sr.steps, reqSec: aggregate(runs.map((r) => r.reqSec)).median });
} }
secureCost.push({ // Reuse the hello scenario's already-computed median so the parity row exactly matches
label: 'security:false (parity)', // the green-tea hello-table number (rather than re-measuring the same server/config).
reqSec: aggregate((await measure(port, '/hello', 'GET')).map((r) => r.reqSec)).median, const helloMedian = scenarioBlocks
}); .find((b) => b.name === 'hello')!
.rows.find((r) => r.framework === 'green-tea')!.reqSec.median;
secureCost.push({ label: 'security:false (parity)', reqSec: helloMedian });
} }
} finally { } finally {
await kill(); await kill();