File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 99 required : false
1010 default : false
1111 type : boolean
12+ routes :
13+ description : ' Comma-separated routes to benchmark (e.g., "/,/hello"). Leave empty to auto-detect from Rails.'
14+ required : false
15+ type : string
1216 rate :
1317 description : ' Requests per second (use "max" for maximum throughput)'
1418 required : false
6266 K6_VERSION : " 1.3.0"
6367 VEGETA_VERSION : " 12.13.0"
6468 # Benchmark parameters
69+ ROUTES : ${{ github.event.inputs.routes }}
6570 RATE : ${{ github.event.inputs.rate || 'max' }}
6671 DURATION : ${{ github.event.inputs.duration || '30s' }}
6772 REQUEST_TIMEOUT : ${{ github.event.inputs.request_timeout || '60s' }}
Original file line number Diff line number Diff line change 1010# Benchmark parameters
1111PRO = ENV . fetch ( "PRO" , "false" ) == "true"
1212APP_DIR = PRO ? "react_on_rails_pro/spec/dummy" : "spec/dummy"
13+ ROUTES = ENV . fetch ( "ROUTES" , nil )
1314BASE_URL = ENV . fetch ( "BASE_URL" , "localhost:3001" )
1415# requests per second; if "max" will get maximum number of queries instead of a fixed rate
1516RATE = ENV . fetch ( "RATE" , "50" )
@@ -90,7 +91,12 @@ def get_benchmark_routes(app_dir)
9091end
9192
9293# Get all routes to benchmark
93- routes = get_benchmark_routes ( APP_DIR )
94+ routes =
95+ if ROUTES
96+ ROUTES . split ( "," ) . map ( &:strip )
97+ else
98+ get_benchmark_routes ( APP_DIR )
99+ end
94100
95101validate_rate ( RATE )
96102validate_positive_integer ( CONNECTIONS , "CONNECTIONS" )
@@ -109,6 +115,7 @@ def get_benchmark_routes(app_dir)
109115puts <<~PARAMS
110116 Benchmark parameters:
111117 - APP_DIR: #{ APP_DIR }
118+ - ROUTES: #{ ROUTES || 'auto-detect from Rails' }
112119 - BASE_URL: #{ BASE_URL }
113120 - RATE: #{ RATE }
114121 - DURATION: #{ DURATION }
You can’t perform that action at this time.
0 commit comments