|
1 | 1 | name: Benchmark Workflow |
2 | 2 |
|
| 3 | +env: |
| 4 | + FORTIO_VERSION: "1.73.0" |
| 5 | + K6_VERSION: "1.3.0" |
| 6 | + VEGETA_VERSION: "12.13.0" |
| 7 | + # Benchmark parameters |
| 8 | + DEFAULT_RATE: &default_rate 'max' |
| 9 | + DEFAULT_DURATION_SEC: &default_duration_sec 30 |
| 10 | + DEFAULT_REQUEST_TIMEOUT: &default_request_timeout '60s' |
| 11 | + DEFAULT_CONNECTIONS: &default_connections 10 |
| 12 | + DEFAULT_WEB_CONCURRENCY: &default_web_concurrency 4 |
| 13 | + DEFAULT_RAILS_THREADS: &default_rails_threads 3 |
| 14 | + DEFAULT_TOOLS: &default_tools 'fortio,vegeta,k6' |
| 15 | + RATE: ${{ github.event.inputs.rate || env.DEFAULT_RATE }} |
| 16 | + DURATION_SEC: ${{ github.event.inputs.duration_sec || env.DEFAULT_DURATION_SEC }} |
| 17 | + REQUEST_TIMEOUT: ${{ github.event.inputs.request_timeout || env.DEFAULT_REQUEST_TIMEOUT }} |
| 18 | + CONNECTIONS: ${{ github.event.inputs.connections || env.DEFAULT_CONNECTIONS }} |
| 19 | + MAX_CONNECTIONS: ${{ github.event.inputs.max_connections || github.event.inputs.connections || env.DEFAULT_CONNECTIONS }} |
| 20 | + WEB_CONCURRENCY: ${{ github.event.inputs.web_concurrency || env.DEFAULT_WEB_CONCURRENCY }} |
| 21 | + RAILS_MAX_THREADS: ${{ github.event.inputs.rails_max_threads || env.DEFAULT_RAILS_THREADS }} |
| 22 | + RAILS_MIN_THREADS: ${{ github.event.inputs.rails_min_threads || github.event.inputs.rails_max_threads || env.DEFAULT_RAILS_THREADS }} |
| 23 | + TOOLS: ${{ github.event.inputs.tools || env.DEFAULT_TOOLS }} |
| 24 | + |
3 | 25 | on: |
4 | 26 | # https://github.com/mxschmitt/action-tmate?tab=readme-ov-file#manually-triggered-debug |
5 | 27 | workflow_dispatch: |
|
12 | 34 | rate: |
13 | 35 | description: 'Requests per second (use "max" for maximum throughput)' |
14 | 36 | required: false |
15 | | - default: 'max' |
| 37 | + default: *default_rate |
16 | 38 | type: string |
17 | 39 | duration_sec: |
18 | 40 | description: 'Duration in seconds' |
19 | 41 | required: false |
20 | | - default: 30 |
| 42 | + default: *default_duration_sec |
21 | 43 | type: number |
22 | 44 | request_timeout: |
23 | 45 | description: 'Request timeout (e.g., "60s", "1m", "90s")' |
24 | 46 | required: false |
25 | | - default: '60s' |
| 47 | + default: *default_request_timeout |
26 | 48 | type: string |
27 | 49 | connections: |
28 | 50 | description: 'Concurrent connections/virtual users' |
29 | 51 | required: false |
30 | | - default: 10 |
| 52 | + default: *default_connections |
31 | 53 | type: number |
32 | 54 | max_connections: |
33 | 55 | description: 'Maximum connections/virtual users' |
|
36 | 58 | web_concurrency: |
37 | 59 | description: 'Number of Puma worker processes' |
38 | 60 | required: false |
39 | | - default: 4 |
| 61 | + default: *default_web_concurrency |
40 | 62 | type: number |
41 | 63 | rails_max_threads: |
42 | 64 | description: 'Maximum number of Puma threads' |
43 | 65 | required: false |
44 | | - default: 3 |
| 66 | + default: *default_rails_threads |
45 | 67 | type: number |
46 | 68 | rails_min_threads: |
47 | 69 | description: 'Minimum number of Puma threads (same as maximum if not set)' |
|
50 | 72 | tools: |
51 | 73 | description: 'Comma-separated list of tools to run' |
52 | 74 | required: false |
53 | | - default: 'fortio,vegeta,k6' |
| 75 | + default: *default_tools |
54 | 76 | type: string |
55 | 77 | push: |
56 | 78 | branches: |
57 | 79 | - master |
58 | 80 | pull_request: |
59 | 81 |
|
60 | | -env: |
61 | | - FORTIO_VERSION: "1.73.0" |
62 | | - K6_VERSION: "1.3.0" |
63 | | - VEGETA_VERSION: "12.13.0" |
64 | | - # Benchmark parameters |
65 | | - RATE: ${{ github.event.inputs.rate || 'max' }} |
66 | | - DURATION_SEC: ${{ github.event.inputs.duration_sec || '30' }} |
67 | | - REQUEST_TIMEOUT: ${{ github.event.inputs.request_timeout || '60s' }} |
68 | | - CONNECTIONS: ${{ github.event.inputs.connections || '10' }} |
69 | | - MAX_CONNECTIONS: ${{ github.event.inputs.max_connections || github.event.inputs.connections || '10' }} |
70 | | - WEB_CONCURRENCY: ${{ github.event.inputs.web_concurrency || '4' }} |
71 | | - RAILS_MAX_THREADS: ${{ github.event.inputs.rails_max_threads || '3' }} |
72 | | - RAILS_MIN_THREADS: ${{ github.event.inputs.rails_min_threads || github.event.inputs.rails_max_threads || '3' }} |
73 | | - TOOLS: ${{ github.event.inputs.tools || 'fortio,vegeta,k6' }} |
74 | | - |
75 | 82 | jobs: |
76 | 83 | benchmark: |
77 | 84 | runs-on: ubuntu-latest |
|
0 commit comments