File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ class Client
55 def initialize
66 @threads = 16
77 @requests = 1000
8+ @host = " localhost"
9+ @port = 3000
810
911 OptionParser .parse! do |parser |
1012 parser.banner = " Usage: time ./bin/benchmark [options]"
@@ -14,12 +16,18 @@ class Client
1416 parser.on(" -r REQUESTS" , " --requests=REQUESTS" , " # of iterations of requests" ) do |requests |
1517 @requests = requests.to_i
1618 end
19+ parser.on(" -h HOST" , " --host=HOST" , " IP / address of host to test" ) do |host |
20+ @host = host
21+ end
22+ parser.on(" -p PORT" , " --port=PORT" , " Port to test" ) do |port |
23+ @port = port.to_i
24+ end
1725 end
1826 end
1927
2028 macro run_spawn
2129 spawn do
22- c = HTTP ::Client .new " localhost " , 3000
30+ c = HTTP ::Client .new @host , @port
2331 @requests .times do |t |
2432 r = c.get " /"
2533 abort " status code should be 200 when GET /" if r.status_code != 200
You can’t perform that action at this time.
0 commit comments