Skip to content

Commit

Permalink
Improved benchmark output (#5077)
Browse files Browse the repository at this point in the history
* Improved benchmark output

* Show benchmarking table
  • Loading branch information
matthewp committed Oct 13, 2022
1 parent d361a3e commit 9e041f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
- name: Run benchmark
id: benchmark-pr
run: |
pnpm run --silent benchmark > ./bench-result.md
result=$(awk '/requests in/' ./bench-result.md)
pnpm run --silent benchmark &> ./bench-result.md
result=$(awk -v RS="" '/┌/' ./bench-result.md)
echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result"
# main benchmark
Expand All @@ -68,8 +68,8 @@ jobs:
- name: Run benchmark
id: benchmark-main
run: |
pnpm run --silent benchmark > ./bench-result.md
result=$(awk '/requests in/' ./bench-result.md)
pnpm run --silent benchmark &> ./bench-result.md
result=$(awk -v RS="" '/┌/' ./bench-result.md)
echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result"
output-benchmark:
Expand All @@ -86,11 +86,15 @@ jobs:
pr_number: ${{ github.event.issue.number }}
message: |
**Node**: 14
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-14 }}
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-14 }}
**PR**:
${{ needs.benchmark.outputs.PR-BENCH-14 }}
**MAIN**:
${{ needs.benchmark.outputs.MAIN-BENCH-14 }}
---
**Node**: 16
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-16 }}
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-16 }}
**PR**:
${{ needs.benchmark.outputs.PR-BENCH-16 }}
**MAIN**:
${{ needs.benchmark.outputs.MAIN-BENCH-16 }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test:vite-ci": "turbo run test --filter=astro --output-logs=new-only --no-deps --concurrency=1",
"test:e2e": "cd packages/astro && pnpm playwright install && pnpm run test:e2e",
"test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match",
"benchmark": "pnpm --filter @benchmark/simple run build && pnpm dlx concurrently -k -s first \"node packages/astro/test/benchmark/simple/server.mjs\" \"pnpm dlx autocannon -c 100 -d 30 -p 10 localhost:3002/\"",
"benchmark": "pnpm --filter @benchmark/simple run build && pnpm dlx concurrently -k -s first --raw \"node packages/astro/test/benchmark/simple/server.mjs\" \"pnpm dlx autocannon -c 100 -d 30 -p 10 localhost:3002/\"",
"lint": "eslint .",
"version": "changeset version && pnpm install --no-frozen-lockfile && pnpm run format"
},
Expand Down

0 comments on commit 9e041f4

Please sign in to comment.