From 985fd7224de825cdea2445a08985ee7308e6051c Mon Sep 17 00:00:00 2001 From: Yang Gao <6821729+criyle@users.noreply.github.com> Date: Thu, 13 Mar 2025 03:52:18 -0400 Subject: [PATCH] benchmark: fix write benchmark.json (#956) --- test/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/main.ts b/test/main.ts index 121719bea..0187b5715 100644 --- a/test/main.ts +++ b/test/main.ts @@ -61,8 +61,8 @@ describe('App', () => { // TODO add more tests + const results: Record = {}; if (process.env.BENCHMARK) { - const results: Record = {}; routes.forEach((route) => it(`Performance test ${route}`, { timeout: 60000 }, async () => { await global.Hydro.model.system.set('limit.global', 99999); const result = await autocannon({ url: `http://localhost:8888${route}` }); @@ -73,7 +73,7 @@ describe('App', () => { after(() => { if (process.env.BENCHMARK) { - const metrics = Object.entries(([k, v]) => ({ + const metrics = Object.entries(results).map(([k, v]) => ({ name: `Benchmark - ${k} - Req/sec`, unit: 'Req/sec', value: v.requests.average,