benchmark-http 0.17.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f35d498b473c7cc8c82776ab7331ce4a2c485d58c060d83eebe54a317399ca8
4
- data.tar.gz: fb60edf59d57d830a5a6534be82595ebe2b796f1279b5bd5cc4fbe1a8cb2e084
3
+ metadata.gz: 3559537d92b2efd74e3cf7b45444befd593248242d175e1206134a1aebd963a1
4
+ data.tar.gz: 28e3e49a4ed3555553624c0a1a4518dcb3275e88f966862e3d3969d82db88b2d
5
5
  SHA512:
6
- metadata.gz: b553fa78afede0571df5d9705de2f4fcdb6fedb0c4bdd1dd6acbcf690382afb468602aeca6c01df6460ce3bec635031be09caed1dc4ca68ad5fb98017c688fbb
7
- data.tar.gz: efc55109fad09796058f5a6a91801b91cf6a4e5c9fc7499e4576e19d041a247286e9e8c84b2de3e963c33a6270621f38ba6e5d4768489ae408af06b241c0488c
6
+ metadata.gz: d9909037132e21ed3e2442efd745f18dd0479deca04d9f0d34935a2a7b8666d232084cceaeab544cc0717e869f725c88b31eba257621f0e3d613b61c9ca01228
7
+ data.tar.gz: 84eb3116458217f57132a204ed47498edb30922537c2fb5f0921ec0f1c4d48a068111be1f0353cfbda54612215d6b3adfaf67953db07e8a295bfaab390f5ba71
checksums.yaml.gz.sig CHANGED
Binary file
data/bin/benchmark-http CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
5
  #
@@ -20,7 +21,7 @@
20
21
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
22
  # THE SOFTWARE.
22
23
 
23
- require_relative '../lib/benchmark/http'
24
+ require_relative "../lib/benchmark/http"
24
25
 
25
26
  begin
26
27
  Benchmark::HTTP::Command.call
@@ -1,16 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2022, by Samuel Williams.
4
+ # Copyright, 2018-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
@@ -19,9 +19,9 @@ module Benchmark
19
19
  self.description = "Determine the optimal level of concurrency."
20
20
 
21
21
  options do
22
- option '-t/--threshold <factor>', "The acceptable latency penalty when making concurrent requests", default: 1.2, type: Float
23
- option '-c/--confidence <factor>', "The confidence required when computing latency (lower is less reliable but faster)", default: 0.99, type: Float
24
- option '-m/--minimum <count>', "The minimum number of connections to make", default: 1, type: Integer
22
+ option "-t/--threshold <factor>", "The acceptable latency penalty when making concurrent requests", default: 1.2, type: Float
23
+ option "-c/--confidence <factor>", "The confidence required when computing latency (lower is less reliable but faster)", default: 0.99, type: Float
24
+ option "-m/--minimum <count>", "The minimum number of connections to make", default: 1, type: Integer
25
25
  end
26
26
 
27
27
  many :hosts, "One or more hosts to benchmark"
@@ -1,16 +1,16 @@
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 @@ module Benchmark
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 @@ module Benchmark
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)
@@ -1,16 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2022, by Samuel Williams.
4
+ # Copyright, 2019-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,7 +20,7 @@ module Benchmark
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/--confidence <factor>', "The confidence required when computing latency (lower is less reliable but faster)", default: 0.99, type: Float
23
+ option "-c/--confidence <factor>", "The confidence required when computing latency (lower is less reliable but faster)", default: 0.99, type: Float
24
24
  end
25
25
 
26
26
  many :hosts, "One or more hosts to benchmark"
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2022, by Samuel Williams.
4
+ # Copyright, 2018-2024, by Samuel Williams.
5
5
 
6
- require_relative '../spider'
6
+ require_relative "../spider"
7
7
 
8
- require 'async/await'
8
+ require "async/await"
9
9
 
10
- require 'samovar'
11
- require 'uri'
12
- require 'console'
10
+ require "samovar"
11
+ require "uri"
12
+ require "console"
13
13
 
14
14
  module Benchmark
15
15
  module HTTP
@@ -20,8 +20,8 @@ module Benchmark
20
20
  self.description = "Spider a website and report on performance."
21
21
 
22
22
  options do
23
- option '-d/--depth <count>', "The number of nested URLs to traverse.", default: 10, type: Integer
24
- option '-h/--headers', "Print out the response headers", default: false
23
+ option "-d/--depth <count>", "The number of nested URLs to traverse.", default: 10, type: Integer
24
+ option "-h/--headers", "Print out the response headers", default: false
25
25
  end
26
26
 
27
27
  many :urls, "One or more hosts to benchmark"
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022, by Samuel Williams.
4
+ # Copyright, 2022-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/barrier'
11
- require 'async/http/client'
12
- require 'async/http/endpoint'
9
+ require "async"
10
+ require "async/barrier"
11
+ require "async/http/client"
12
+ require "async/http/endpoint"
13
13
 
14
- require 'samovar'
14
+ require "samovar"
15
15
 
16
16
  module Benchmark
17
17
  module HTTP
@@ -20,7 +20,7 @@ module Benchmark
20
20
  self.description = "Measure how long it takes for an endpoint to become accessible."
21
21
 
22
22
  options do
23
- option '-w/--wait <time>', "The maximum wait time.", default: 10, type: Float
23
+ option "-w/--wait <time>", "The maximum wait time.", default: 10, type: Float
24
24
  end
25
25
 
26
26
  many :hosts, "The hosts to wait for."
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2022, by Samuel Williams.
4
+ # Copyright, 2018-2024, by Samuel Williams.
5
5
 
6
- require_relative 'command/latency'
7
- require_relative 'command/concurrency'
8
- require_relative 'command/spider'
9
- require_relative 'command/hammer'
10
- require_relative 'command/wait'
6
+ require_relative "command/latency"
7
+ require_relative "command/concurrency"
8
+ require_relative "command/spider"
9
+ require_relative "command/hammer"
10
+ require_relative "command/wait"
11
11
 
12
- require_relative 'version'
13
- require 'samovar'
14
- require 'console'
12
+ require_relative "version"
13
+ require "samovar"
14
+ require "console"
15
15
 
16
16
  module Benchmark
17
17
  module HTTP
@@ -24,17 +24,17 @@ module Benchmark
24
24
  self.description = "An asynchronous HTTP server benchmark."
25
25
 
26
26
  options do
27
- option '--verbose | --quiet', "Verbosity of output for debugging.", key: :logging
28
- option '-h/--help', "Print out help information."
29
- option '-v/--version', "Print out the application version."
27
+ option "--verbose | --quiet", "Verbosity of output for debugging.", key: :logging
28
+ option "-h/--help", "Print out help information."
29
+ option "-v/--version", "Print out the application version."
30
30
  end
31
31
 
32
32
  nested :command, {
33
- 'latency' => Latency,
34
- 'concurrency' => Concurrency,
35
- 'spider' => Spider,
36
- 'hammer' => Hammer,
37
- 'wait' => Wait,
33
+ "latency" => Latency,
34
+ "concurrency" => Concurrency,
35
+ "spider" => Spider,
36
+ "hammer" => Hammer,
37
+ "wait" => Wait,
38
38
  }
39
39
 
40
40
  def verbose?
@@ -3,7 +3,7 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2018-2024, by Samuel Williams.
5
5
 
6
- require 'xrb/sanitize'
6
+ require "xrb/sanitize"
7
7
 
8
8
  module Benchmark
9
9
  module HTTP
@@ -19,10 +19,10 @@ module Benchmark
19
19
  attr :links
20
20
 
21
21
  def filter(node)
22
- if node.name == 'base'
23
- @base = node['href']
24
- elsif node.name == 'a' and node['href'] and node['rel'] != 'nofollow'
25
- @links << node['href']
22
+ if node.name == "base"
23
+ @base = node["href"]
24
+ elsif node.name == "a" and node["href"] and node["rel"] != "nofollow"
25
+ @links << node["href"]
26
26
  end
27
27
 
28
28
  node.skip!(TAG)
@@ -1,19 +1,19 @@
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'
8
- require_relative 'links_filter'
6
+ require_relative "seconds"
7
+ require_relative "statistics"
8
+ require_relative "links_filter"
9
9
 
10
- require 'async'
11
- require 'async/http/client'
12
- require 'async/http/endpoint'
13
- require 'async/await'
10
+ require "async"
11
+ require "async/http/client"
12
+ require "async/http/endpoint"
13
+ require "async/await"
14
14
 
15
- require 'uri'
16
- require 'console'
15
+ require "uri"
16
+ require "console"
17
17
 
18
18
  module Benchmark
19
19
  module HTTP
@@ -76,7 +76,7 @@ module Benchmark
76
76
  yield("HEAD", url, response) if block_given?
77
77
 
78
78
  if response.redirection?
79
- location = url + response.headers['location']
79
+ location = url + response.headers["location"]
80
80
  if location.host == url.host
81
81
  Console.logger.debug(self) {"Following redirect to #{location}..."}
82
82
  fetch(statistics, client, location, depth&.-(1), fetched, &block).wait
@@ -87,8 +87,8 @@ module Benchmark
87
87
  end
88
88
  end
89
89
 
90
- content_type = response.headers['content-type']
91
- unless content_type&.start_with? 'text/html'
90
+ content_type = response.headers["content-type"]
91
+ unless content_type&.start_with? "text/html"
92
92
  # puts "Unsupported content type: #{content_type}"
93
93
  return
94
94
  end
@@ -114,7 +114,7 @@ module Benchmark
114
114
  urls.each do |url|
115
115
  endpoint = Async::HTTP::Endpoint.parse(url, timeout: 10)
116
116
 
117
- Async::HTTP::Client.open(endpoint, protocol: endpoint.protocol, connection_limit: 4) do |client|
117
+ Async::HTTP::Client.open(endpoint, protocol: endpoint.protocol, limit: 4) do |client|
118
118
  fetch(statistics, client, endpoint.url, &block).wait
119
119
  end
120
120
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2022, by Samuel Williams.
4
+ # Copyright, 2018-2024, by Samuel Williams.
5
5
 
6
- require 'async/clock'
6
+ require "async/clock"
7
7
 
8
8
  module Benchmark
9
9
  module HTTP
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2023, by Samuel Williams.
4
+ # Copyright, 2018-2024, by Samuel Williams.
5
5
 
6
6
  module Benchmark
7
7
  module HTTP
8
- VERSION = "0.17.0"
8
+ VERSION = "0.18.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -196,8 +196,8 @@ We welcome contributions to this project.
196
196
 
197
197
  ### Developer Certificate of Origin
198
198
 
199
- This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
199
+ In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
200
200
 
201
- ### Contributor Covenant
201
+ ### Community Guidelines
202
202
 
203
- This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
203
+ This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -38,7 +38,7 @@ cert_chain:
38
38
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
39
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
40
  -----END CERTIFICATE-----
41
- date: 2024-05-08 00:00:00.000000000 Z
41
+ date: 2024-11-18 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: async-await
@@ -60,28 +60,14 @@ dependencies:
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '0.54'
63
+ version: '0.83'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '0.54'
71
- - !ruby/object:Gem::Dependency
72
- name: async-io
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '1.5'
78
- type: :runtime
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: '1.5'
70
+ version: '0.83'
85
71
  - !ruby/object:Gem::Dependency
86
72
  name: console
87
73
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
153
  - !ruby/object:Gem::Version
168
154
  version: '0'
169
155
  requirements: []
170
- rubygems_version: 3.5.3
156
+ rubygems_version: 3.5.22
171
157
  signing_key:
172
158
  specification_version: 4
173
159
  summary: An asynchronous benchmark toolbox for modern HTTP servers.
metadata.gz.sig CHANGED
Binary file