Improved benchmark output (#5077)

* Improved benchmark output

* Show benchmarking table
This commit is contained in:
Matthew Phillips 2022-10-13 15:22:51 -04:00 committed by GitHub
parent d361a3ec35
commit 9e041f464c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View file

@ -48,8 +48,8 @@ jobs:
- name: Run benchmark - name: Run benchmark
id: benchmark-pr id: benchmark-pr
run: | run: |
pnpm run --silent benchmark > ./bench-result.md pnpm run --silent benchmark &> ./bench-result.md
result=$(awk '/requests in/' ./bench-result.md) result=$(awk -v RS="" '/┌/' ./bench-result.md)
echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result" echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result"
# main benchmark # main benchmark
@ -68,8 +68,8 @@ jobs:
- name: Run benchmark - name: Run benchmark
id: benchmark-main id: benchmark-main
run: | run: |
pnpm run --silent benchmark > ./bench-result.md pnpm run --silent benchmark &> ./bench-result.md
result=$(awk '/requests in/' ./bench-result.md) result=$(awk -v RS="" '/┌/' ./bench-result.md)
echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result" echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result"
output-benchmark: output-benchmark:
@ -86,11 +86,15 @@ jobs:
pr_number: ${{ github.event.issue.number }} pr_number: ${{ github.event.issue.number }}
message: | message: |
**Node**: 14 **Node**: 14
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-14 }} **PR**:
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-14 }} ${{ needs.benchmark.outputs.PR-BENCH-14 }}
**MAIN**:
${{ needs.benchmark.outputs.MAIN-BENCH-14 }}
--- ---
**Node**: 16 **Node**: 16
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-16 }} **PR**:
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-16 }} ${{ needs.benchmark.outputs.PR-BENCH-16 }}
**MAIN**:
${{ needs.benchmark.outputs.MAIN-BENCH-16 }}

View file

@ -23,7 +23,7 @@
"test:vite-ci": "turbo run test --filter=astro --output-logs=new-only --no-deps --concurrency=1", "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": "cd packages/astro && pnpm playwright install && pnpm run test:e2e",
"test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match", "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 .", "lint": "eslint .",
"version": "changeset version && pnpm install --no-frozen-lockfile && pnpm run format" "version": "changeset version && pnpm install --no-frozen-lockfile && pnpm run format"
}, },