benchmark_ab.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: benchmark-ab
  2. # Manual A/B throughput comparison between two refs.
  3. #
  4. # This is a measurement, not a test: it never fails the build on a slow result.
  5. # Absolute req/s from a shared runner is meaningless on its own, so both refs
  6. # are built and measured alternately in the same job and only the ratio of the
  7. # medians is reported, with a permutation test to say whether the difference
  8. # stands out from the run-to-run noise.
  9. #
  10. # Non-SSL and Linux only for now.
  11. on:
  12. workflow_dispatch:
  13. inputs:
  14. base:
  15. description: "Baseline ref"
  16. required: false
  17. default: "origin/master"
  18. head:
  19. description: "Ref to compare (defaults to the ref this run was started on)"
  20. required: false
  21. default: ""
  22. rounds:
  23. description: "Measurement rounds per ref (9+ recommended; below 4 the test can never reach significance)"
  24. required: false
  25. default: "9"
  26. duration:
  27. description: "Load duration per measurement"
  28. required: false
  29. default: "5s"
  30. connections:
  31. description: "Concurrent connections"
  32. required: false
  33. default: "10"
  34. permissions:
  35. contents: read
  36. jobs:
  37. ubuntu:
  38. runs-on: ubuntu-latest
  39. steps:
  40. - name: checkout
  41. uses: actions/checkout@v4
  42. with:
  43. fetch-depth: 0
  44. - name: install bombardier
  45. run: go install github.com/codesenberg/bombardier@latest
  46. - name: run A/B benchmark
  47. run: |
  48. export PATH="$(go env GOPATH)/bin:$PATH"
  49. HEAD_REF="${{ inputs.head }}"
  50. if [ -z "$HEAD_REF" ]; then HEAD_REF="${{ github.sha }}"; fi
  51. ./benchmark/ab.sh \
  52. --base "${{ inputs.base }}" \
  53. --head "$HEAD_REF" \
  54. --rounds "${{ inputs.rounds }}" \
  55. --duration "${{ inputs.duration }}" \
  56. --connections "${{ inputs.connections }}"