1
1
# frozen_string_literal: true
2
2
3
3
# Released under the MIT License.
4
- # Copyright, 2020-2022 , by Samuel Williams.
4
+ # Copyright, 2020-2024 , by Samuel Williams.
5
5
6
- require_relative ' ../seconds'
7
- require_relative ' ../statistics'
6
+ require_relative " ../seconds"
7
+ require_relative " ../statistics"
8
8
9
- require ' async'
10
- require ' async/http/client'
11
- require ' async/http/endpoint'
9
+ require " async"
10
+ require " async/http/client"
11
+ require " async/http/endpoint"
12
12
13
- require ' samovar'
13
+ require " samovar"
14
14
15
15
module Benchmark
16
16
module HTTP
@@ -20,10 +20,10 @@ class Hammer < Samovar::Command
20
20
21
21
options do
22
22
option "-k/--concurrency <count>" , "The number of simultaneous connections to make." , default : 1 , type : Integer
23
- option ' -c/--count <integer>' , "The number of requests to make per connection." , default : 10_000 , type : Integer
23
+ option " -c/--count <integer>" , "The number of requests to make per connection." , default : 10_000 , type : Integer
24
24
25
- option ' -i/--interval <integer>' , "The time to wait between measurements." , default : nil , type : Integer
26
- option ' --alpn-protocols <name,name>' , "Force specific ALPN protocols during connection negotiation." , default : nil , type : String
25
+ option " -i/--interval <integer>" , "The time to wait between measurements." , default : nil , type : Integer
26
+ option " --alpn-protocols <name,name>" , "Force specific ALPN protocols during connection negotiation." , default : nil , type : String
27
27
end
28
28
29
29
many :urls , "The urls to hammer."
@@ -70,7 +70,7 @@ def measure_performance(concurrency, count, endpoint, request_path)
70
70
end
71
71
72
72
def alpn_protocols
73
- @options [ :alpn_protocols ] &.split ( ',' )
73
+ @options [ :alpn_protocols ] &.split ( "," )
74
74
end
75
75
76
76
def run ( url )
0 commit comments