benchmark-http 0.16.1 → 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: f4c0dd5e1f2fcaa19df57637f954b2a2e791af4f617ff3f36272b76a47bc66b7
4
- data.tar.gz: 871e461daa3a6efe6cb943853347b3fa1913aa5a833b2973aad6e1f1e40029ba
3
+ metadata.gz: 3559537d92b2efd74e3cf7b45444befd593248242d175e1206134a1aebd963a1
4
+ data.tar.gz: 28e3e49a4ed3555553624c0a1a4518dcb3275e88f966862e3d3969d82db88b2d
5
5
  SHA512:
6
- metadata.gz: 365badabf9ab7b3d8f428db0593e8d306e2c0755a6ebf61737919678873e9465d3e52c04c9ab6ec057bb2b97a7b35a44530db140266486aec8a0b3a697b1feda
7
- data.tar.gz: 034306fa6be3ec62e6d469f45551023087e206d0ab486d71893c79de030f4f01a6f0aa44286682c5a96e26ef97e7a0ef54776f7624147ac5a53f359737a181a8
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?
@@ -1,13 +1,13 @@
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 'trenni/sanitize'
6
+ require "xrb/sanitize"
7
7
 
8
8
  module Benchmark
9
9
  module HTTP
10
- class LinksFilter < Trenni::Sanitize::Filter
10
+ class LinksFilter < XRB::Sanitize::Filter
11
11
  def initialize(*)
12
12
  super
13
13
 
@@ -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-2022, by Samuel Williams.
4
+ # Copyright, 2018-2024, by Samuel Williams.
5
5
 
6
6
  module Benchmark
7
7
  module HTTP
8
- VERSION = "0.16.1"
8
+ VERSION = "0.18.0"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2018-2022, by Samuel Williams.
3
+ Copyright, 2018-2024, by Samuel Williams.
4
+ Copyright, 2020, by Olle Jonsson.
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -193,3 +193,11 @@ We welcome contributions to this project.
193
193
  3. Commit your changes (`git commit -am 'Add some feature'`).
194
194
  4. Push to the branch (`git push origin my-new-feature`).
195
195
  5. Create new Pull Request.
196
+
197
+ ### Developer Certificate of Origin
198
+
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
+
201
+ ### Community Guidelines
202
+
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.16.1
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: 2023-02-21 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
@@ -111,7 +97,7 @@ dependencies:
111
97
  - !ruby/object:Gem::Version
112
98
  version: '2.0'
113
99
  - !ruby/object:Gem::Dependency
114
- name: trenni-sanitize
100
+ name: xrb-sanitize
115
101
  requirement: !ruby/object:Gem::Requirement
116
102
  requirements:
117
103
  - - ">="
@@ -124,76 +110,6 @@ dependencies:
124
110
  - - ">="
125
111
  - !ruby/object:Gem::Version
126
112
  version: '0'
127
- - !ruby/object:Gem::Dependency
128
- name: async-rspec
129
- requirement: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - ">="
132
- - !ruby/object:Gem::Version
133
- version: '0'
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- version: '0'
141
- - !ruby/object:Gem::Dependency
142
- name: bake-test
143
- requirement: !ruby/object:Gem::Requirement
144
- requirements:
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- version: '0'
148
- type: :development
149
- prerelease: false
150
- version_requirements: !ruby/object:Gem::Requirement
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: '0'
155
- - !ruby/object:Gem::Dependency
156
- name: bundler
157
- requirement: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - ">="
160
- - !ruby/object:Gem::Version
161
- version: '0'
162
- type: :development
163
- prerelease: false
164
- version_requirements: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- version: '0'
169
- - !ruby/object:Gem::Dependency
170
- name: covered
171
- requirement: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - "~>"
174
- - !ruby/object:Gem::Version
175
- version: '0.16'
176
- type: :development
177
- prerelease: false
178
- version_requirements: !ruby/object:Gem::Requirement
179
- requirements:
180
- - - "~>"
181
- - !ruby/object:Gem::Version
182
- version: '0.16'
183
- - !ruby/object:Gem::Dependency
184
- name: sus
185
- requirement: !ruby/object:Gem::Requirement
186
- requirements:
187
- - - "~>"
188
- - !ruby/object:Gem::Version
189
- version: '0.12'
190
- type: :development
191
- prerelease: false
192
- version_requirements: !ruby/object:Gem::Requirement
193
- requirements:
194
- - - "~>"
195
- - !ruby/object:Gem::Version
196
- version: '0.12'
197
113
  description:
198
114
  email:
199
115
  executables:
@@ -219,7 +135,9 @@ files:
219
135
  homepage: https://github.com/socketry/benchmark-http
220
136
  licenses:
221
137
  - MIT
222
- metadata: {}
138
+ metadata:
139
+ documentation_uri: https://socketry.github.io/benchmark-http/
140
+ source_code_uri: https://github.com/socketry/benchmark-http.git
223
141
  post_install_message:
224
142
  rdoc_options: []
225
143
  require_paths:
@@ -228,14 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
228
146
  requirements:
229
147
  - - ">="
230
148
  - !ruby/object:Gem::Version
231
- version: '2.4'
149
+ version: '3.1'
232
150
  required_rubygems_version: !ruby/object:Gem::Requirement
233
151
  requirements:
234
152
  - - ">="
235
153
  - !ruby/object:Gem::Version
236
154
  version: '0'
237
155
  requirements: []
238
- rubygems_version: 3.4.6
156
+ rubygems_version: 3.5.22
239
157
  signing_key:
240
158
  specification_version: 4
241
159
  summary: An asynchronous benchmark toolbox for modern HTTP servers.
metadata.gz.sig CHANGED
Binary file