benchmark: fix write benchmark.json (#956)

This commit is contained in:
Yang Gao authored and GitHub committed 2025-03-13 07:52:18 +00:00
1 parent f36c13dcf5
commit 985fd7224d
1 file changed
+2 -2
+2 -2
View File
@@ -61,8 +61,8 @@ describe('App', () => {
// TODO add more tests
const results: Record<string, autocannon.Result> = {};
if (process.env.BENCHMARK) {
const results: Record<string, autocannon.Result> = {};
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,