benchmark-http 0.13.0 → 0.15.1

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: 13d218f8460468f4e36bfee9339ce124a4a850681c8fb5f007290cfadec71440
4
- data.tar.gz: 67f837ffda547018fd5a15bb21e31fa5fb70c2b0506fa5ae0628bbfe7af65e1a
3
+ metadata.gz: e94467fbbb53392ece96740e56933598ed0a301f8f6a897976e0d6ed59c2b5a0
4
+ data.tar.gz: e6ca7937b05e889a91cfca556b715c92724515caaa4bdbecfd523951a16d8739
5
5
  SHA512:
6
- metadata.gz: 93f1d330ac3e0eb517deb422a41dc31796b2018949e91a7c1a694c53710d895ffb9af23ac95f41523c03cb0dcda243fd59d3781e4545243c1f0ce3eb4019ab98
7
- data.tar.gz: c88bb8bdd60d1a281381f24b30e84a09fc63aa5642a58a1c878dc35df33d7bdcc04c0bf2979fec219a14a10ea0eb40ad59153ac21d7ebbda56ac0b7b26d91daf
6
+ metadata.gz: 172464957224504d73e77fef8139beb33d19d9fe9098b42bf92393617a3f3dcdfee05f7aace4d8909ae05e6b03d9d60405a5e971055367372ab8e989c4aea135
7
+ data.tar.gz: ba6cb3332488f08e49d90e707d6333d34b56334e3bd575b4f7d9cb129b4dee75b9bc7a3a318a3be392f01a13594fd6537921bda27800aa53f58a38584da92d67
@@ -54,7 +54,7 @@ module Benchmark
54
54
 
55
55
  concurrency.times.map do
56
56
  task.async do
57
- client = Async::HTTP::Client.new(endpoint, endpoint.protocol)
57
+ client = Async::HTTP::Client.new(endpoint, protocol: endpoint.protocol)
58
58
 
59
59
  statistics.sample(confidence_factor) do
60
60
  response = client.get(request_path).tap(&:finish)
@@ -36,6 +36,9 @@ module Benchmark
36
36
  options do
37
37
  option "-k/--concurrency <count>", "The number of simultaneous connections to make.", default: 1, type: Integer
38
38
  option '-c/--count <integer>', "The number of requests to make per connection.", default: 10_000, type: Integer
39
+
40
+ option '-i/--interval <integer>', "The time to wait between measurements.", default: nil, type: Integer
41
+ option '--alpn-protocols <name,name>', "Force specific ALPN protocols during connection negotiation.", default: nil, type: String
39
42
  end
40
43
 
41
44
  many :urls, "The urls to hammer."
@@ -56,7 +59,7 @@ module Benchmark
56
59
 
57
60
  concurrency.times.map do
58
61
  task.async do
59
- client = Async::HTTP::Client.new(endpoint, endpoint.protocol)
62
+ client = Async::HTTP::Client.new(endpoint, protocol: endpoint.protocol)
60
63
 
61
64
  count.times do |i|
62
65
  statistics.measure do
@@ -80,13 +83,17 @@ module Benchmark
80
83
  return statistics
81
84
  end
82
85
 
86
+ def alpn_protocols
87
+ @options[:alpn_protocols]&.split(',')
88
+ end
89
+
83
90
  def run(url)
84
- endpoint = Async::HTTP::Endpoint.parse(url)
91
+ endpoint = Async::HTTP::Endpoint.parse(url, alpn_protocols: self.alpn_protocols)
85
92
  request_path = endpoint.url.request_uri
86
93
 
87
94
  puts "I am going to benchmark #{url}..."
88
95
 
89
- Async::Reactor.run do |task|
96
+ Async do |task|
90
97
  statistics = []
91
98
 
92
99
  base = measure_performance(@options[:concurrency], @options[:count], endpoint, request_path)
@@ -94,8 +101,16 @@ module Benchmark
94
101
  end
95
102
 
96
103
  def call
97
- @urls.each do |url|
98
- run(url).wait
104
+ while true
105
+ @urls.each do |url|
106
+ run(url).wait
107
+ end
108
+
109
+ if @interval
110
+ sleep(@interval)
111
+ else
112
+ break
113
+ end
99
114
  end
100
115
  end
101
116
  end
@@ -52,7 +52,7 @@ module Benchmark
52
52
 
53
53
  concurrency.times.map do
54
54
  task.async do
55
- client = Async::HTTP::Client.new(endpoint, endpoint.protocol)
55
+ client = Async::HTTP::Client.new(endpoint, protocol: endpoint.protocol)
56
56
 
57
57
  statistics.sample(confidence_factor) do
58
58
  response = client.get(request_path).tap(&:finish)
@@ -24,6 +24,7 @@ require 'async/await'
24
24
 
25
25
  require 'samovar'
26
26
  require 'uri'
27
+ require 'console'
27
28
 
28
29
  module Benchmark
29
30
  module HTTP
@@ -41,7 +42,7 @@ module Benchmark
41
42
  many :urls, "One or more hosts to benchmark"
42
43
 
43
44
  def log(method, url, response)
44
- Async.logger.call(self, severity: (response.failure? ? :warn : :info)) do |buffer|
45
+ Console.logger.call(self, severity: (response.failure? ? :warn : :info)) do |buffer|
45
46
  buffer.puts "#{method} #{url} -> #{response.version} #{response.status} (#{response.body&.length || 'unspecified'} bytes)"
46
47
 
47
48
  response.headers.each do |key, value|
@@ -25,6 +25,7 @@ require_relative 'command/hammer'
25
25
 
26
26
  require_relative 'version'
27
27
  require 'samovar'
28
+ require 'console'
28
29
 
29
30
  module Benchmark
30
31
  module HTTP
@@ -59,11 +60,11 @@ module Benchmark
59
60
 
60
61
  def call
61
62
  if verbose?
62
- Async.logger.debug!
63
+ Console.logger.debug!
63
64
  elsif quiet?
64
- Async.logger.warn!
65
+ Console.logger.warn!
65
66
  else
66
- Async.logger.info!
67
+ Console.logger.info!
67
68
  end
68
69
 
69
70
  if @options[:version]
@@ -28,6 +28,7 @@ require 'async/http/endpoint'
28
28
  require 'async/await'
29
29
 
30
30
  require 'uri'
31
+ require 'console'
31
32
 
32
33
  module Benchmark
33
34
  module HTTP
@@ -47,7 +48,7 @@ module Benchmark
47
48
  begin
48
49
  filter = LinksFilter.parse(body)
49
50
  rescue
50
- Async.logger.error(self) {$!}
51
+ Console.logger.error(self) {$!}
51
52
  return []
52
53
  end
53
54
 
@@ -65,7 +66,7 @@ module Benchmark
65
66
  yield full_url
66
67
  end
67
68
  rescue ArgumentError, URI::InvalidURIError
68
- Async.logger.warn(self) {"Could not fetch #{href}, relative to #{base}!"}
69
+ Console.logger.warn(self) {"Could not fetch #{href}, relative to #{base}!"}
69
70
  next # Don't accumulate an item into the resulting array.
70
71
  end
71
72
  end.compact
@@ -73,7 +74,7 @@ module Benchmark
73
74
 
74
75
  async def fetch(statistics, client, url, depth = @depth, fetched = Set.new, &block)
75
76
  if depth&.zero?
76
- Async.logger.warn(self) {"Exceeded depth while trying to visit #{url}!"}
77
+ Console.logger.warn(self) {"Exceeded depth while trying to visit #{url}!"}
77
78
  return
78
79
  elsif fetched.include?(url)
79
80
  return
@@ -92,11 +93,11 @@ module Benchmark
92
93
  if response.redirection?
93
94
  location = url + response.headers['location']
94
95
  if location.host == url.host
95
- Async.logger.debug(self) {"Following redirect to #{location}..."}
96
+ Console.logger.debug(self) {"Following redirect to #{location}..."}
96
97
  fetch(statistics, client, location, depth&.-(1), fetched, &block).wait
97
98
  return
98
99
  else
99
- Async.logger.debug(self) {"Ignoring redirect to #{location}."}
100
+ Console.logger.debug(self) {"Ignoring redirect to #{location}."}
100
101
  return
101
102
  end
102
103
  end
@@ -114,12 +115,12 @@ module Benchmark
114
115
  yield("GET", url, response) if block_given?
115
116
 
116
117
  extract_links(url, response) do |href|
117
- fetch(statistics, client, href, depth - 1, fetched, &block)
118
+ fetch(statistics, client, href, depth&.-(1), fetched, &block)
118
119
  end.each(&:wait)
119
120
  rescue Async::TimeoutError
120
- Async.logger.error(self) {"Timeout while fetching #{url}"}
121
+ Console.logger.error(self) {"Timeout while fetching #{url}"}
121
122
  rescue StandardError
122
- Async.logger.error(self) {$!}
123
+ Console.logger.error(self) {$!}
123
124
  end
124
125
 
125
126
  sync def call(urls, &block)
@@ -128,7 +129,7 @@ module Benchmark
128
129
  urls.each do |url|
129
130
  endpoint = Async::HTTP::Endpoint.parse(url, timeout: 10)
130
131
 
131
- Async::HTTP::Client.open(endpoint, endpoint.protocol, connection_limit: 4) do |client|
132
+ Async::HTTP::Client.open(endpoint, protocol: endpoint.protocol, connection_limit: 4) do |client|
132
133
  fetch(statistics, client, endpoint.url, &block).wait
133
134
  end
134
135
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Benchmark
22
22
  module HTTP
23
- VERSION = "0.13.0"
23
+ VERSION = "0.15.1"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,59 +1,59 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-14 00:00:00.000000000 Z
11
+ date: 2021-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: async-io
14
+ name: async-await
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.5'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: async-http
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.45'
33
+ version: '0.54'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.45'
40
+ version: '0.54'
41
41
  - !ruby/object:Gem::Dependency
42
- name: async-await
42
+ name: async-io
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.5'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.5'
55
55
  - !ruby/object:Gem::Dependency
56
- name: trenni-sanitize
56
+ name: console
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -81,13 +81,13 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: covered
84
+ name: trenni-sanitize
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
- type: :development
90
+ type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: covered
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: rake
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -150,22 +164,13 @@ dependencies:
150
164
  - - "~>"
151
165
  - !ruby/object:Gem::Version
152
166
  version: '3.0'
153
- description:
167
+ description:
154
168
  email:
155
- - samuel.williams@oriontransfer.co.nz
156
169
  executables:
157
170
  - benchmark-http
158
171
  extensions: []
159
172
  extra_rdoc_files: []
160
173
  files:
161
- - ".editorconfig"
162
- - ".gitignore"
163
- - ".rspec"
164
- - ".travis.yml"
165
- - Gemfile
166
- - README.md
167
- - Rakefile
168
- - benchmark-http.gemspec
169
174
  - bin/benchmark-http
170
175
  - lib/benchmark/http.rb
171
176
  - lib/benchmark/http/command.rb
@@ -179,15 +184,16 @@ files:
179
184
  - lib/benchmark/http/statistics.rb
180
185
  - lib/benchmark/http/version.rb
181
186
  homepage: https://github.com/socketry/benchmark-http
182
- licenses: []
187
+ licenses:
188
+ - MIT
183
189
  metadata: {}
184
- post_install_message:
190
+ post_install_message:
185
191
  rdoc_options: []
186
192
  require_paths:
187
193
  - lib
188
194
  required_ruby_version: !ruby/object:Gem::Requirement
189
195
  requirements:
190
- - - "~>"
196
+ - - ">="
191
197
  - !ruby/object:Gem::Version
192
198
  version: '2.4'
193
199
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -196,8 +202,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
202
  - !ruby/object:Gem::Version
197
203
  version: '0'
198
204
  requirements: []
199
- rubygems_version: 3.1.2
200
- signing_key:
205
+ rubygems_version: 3.2.32
206
+ signing_key:
201
207
  specification_version: 4
202
208
  summary: An asynchronous benchmark toolbox for modern HTTP servers.
203
209
  test_files: []
data/.editorconfig DELETED
@@ -1,6 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = tab
5
- indent_size = 2
6
-
data/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
-
13
- Gemfile.lock
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,16 +0,0 @@
1
- language: ruby
2
- dist: xenial
3
- cache: bundler
4
-
5
- matrix:
6
- include:
7
- - rvm: 2.4
8
- - rvm: 2.5
9
- - rvm: 2.6
10
- - rvm: 2.7
11
- - rvm: jruby-head
12
- env: JRUBY_OPTS="--debug -X+O"
13
- - rvm: ruby-head
14
- allow_failures:
15
- - rvm: ruby-head
16
- - rvm: jruby-head
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- group :development do
6
- gem 'pry'
7
- end
data/README.md DELETED
@@ -1,223 +0,0 @@
1
- # Benchmark::HTTP
2
-
3
- An asynchronous HTTP benchmark tool built on top of [async], [async-io] and [async-http]. Useful for analysing server performance. Supports HTTP1 and HTTP2.
4
-
5
- [![Build Status](https://secure.travis-ci.org/socketry/benchmark-http.svg)](http://travis-ci.org/socketry/benchmark-http)
6
- [![Code Climate](https://codeclimate.com/github/socketry/benchmark-http.svg)](https://codeclimate.com/github/socketry/benchmark-http)
7
- [![Coverage Status](https://coveralls.io/repos/socketry/benchmark-http/badge.svg)](https://coveralls.io/r/socketry/benchmark-http)
8
-
9
- [async]: https://github.com/socketry/async
10
- [async-io]: https://github.com/socketry/async-io
11
- [async-http]: https://github.com/socketry/async-http
12
-
13
- ## Installation
14
-
15
- Install it yourself:
16
-
17
- $ gem install benchmark-http
18
-
19
- ## Usage
20
-
21
- You can run `benchmark-http` is a top level tool for invoking specific benchmarks.
22
-
23
- ### Spider
24
-
25
- This benchmark spiders a website and generates some statistics on general access time.
26
-
27
- ```shell
28
- $ benchmark-http spider https://www.oriontransfer.co.nz/welcome/index
29
- HEAD https://www.oriontransfer.co.nz/welcome/index -> HTTP/2.0 404 (unspecified bytes)
30
- GET https://www.oriontransfer.co.nz/welcome/index (depth = 10)
31
- GET https://www.oriontransfer.co.nz/welcome/index -> HTTP/2.0 404 (2263 bytes)
32
- HEAD https://www.oriontransfer.co.nz/products/index -> HTTP/2.0 200 (unspecified bytes)
33
- GET https://www.oriontransfer.co.nz/products/index (depth = 9)
34
- HEAD https://www.oriontransfer.co.nz/services/index -> HTTP/2.0 200 (unspecified bytes)
35
- GET https://www.oriontransfer.co.nz/services/index (depth = 9)
36
- HEAD https://www.oriontransfer.co.nz/support/index -> HTTP/2.0 200 (unspecified bytes)
37
- GET https://www.oriontransfer.co.nz/support/index (depth = 9)
38
- HEAD https://www.oriontransfer.co.nz/support/contact-us -> HTTP/2.0 307 (unspecified bytes)
39
- Following redirect to https://www.oriontransfer.co.nz/support/contact-us/index...
40
- HEAD https://www.oriontransfer.co.nz/support/terms-of-service -> HTTP/2.0 200 (unspecified bytes)
41
- GET https://www.oriontransfer.co.nz/support/terms-of-service (depth = 9)
42
- GET https://www.oriontransfer.co.nz/products/index -> HTTP/2.0 200 (3469 bytes)
43
- GET https://www.oriontransfer.co.nz/services/index -> HTTP/2.0 200 (2488 bytes)
44
- GET https://www.oriontransfer.co.nz/support/index -> HTTP/2.0 200 (2246 bytes)
45
- HEAD https://www.oriontransfer.co.nz/support/contact-us/index -> HTTP/2.0 200 (unspecified bytes)
46
- GET https://www.oriontransfer.co.nz/support/contact-us/index (depth = 8)
47
- GET https://www.oriontransfer.co.nz/support/terms-of-service -> HTTP/2.0 200 (8466 bytes)
48
- HEAD https://www.oriontransfer.co.nz/products/library-inspector/index -> HTTP/2.0 200 (unspecified bytes)
49
- GET https://www.oriontransfer.co.nz/products/library-inspector/index (depth = 8)
50
- HEAD https://www.oriontransfer.co.nz/products/truth-tables/index -> HTTP/2.0 200 (unspecified bytes)
51
- GET https://www.oriontransfer.co.nz/products/truth-tables/index (depth = 8)
52
- HEAD https://www.oriontransfer.co.nz/products/fingerprint/index -> HTTP/2.0 200 (unspecified bytes)
53
- GET https://www.oriontransfer.co.nz/products/fingerprint/index (depth = 8)
54
- HEAD https://www.oriontransfer.co.nz/services/internet-services -> HTTP/2.0 200 (unspecified bytes)
55
- GET https://www.oriontransfer.co.nz/services/internet-services (depth = 8)
56
- HEAD https://www.oriontransfer.co.nz/services/software-development -> HTTP/2.0 200 (unspecified bytes)
57
- GET https://www.oriontransfer.co.nz/services/software-development (depth = 8)
58
- HEAD https://www.oriontransfer.co.nz/services/systems-administration -> HTTP/2.0 200 (unspecified bytes)
59
- GET https://www.oriontransfer.co.nz/services/systems-administration (depth = 8)
60
- HEAD https://www.oriontransfer.co.nz/services/website-development -> HTTP/2.0 200 (unspecified bytes)
61
- GET https://www.oriontransfer.co.nz/services/website-development (depth = 8)
62
- HEAD https://www.oriontransfer.co.nz/support/contact-us/ -> HTTP/2.0 307 (unspecified bytes)
63
- Following redirect to https://www.oriontransfer.co.nz/support/contact-us/index...
64
- GET https://www.oriontransfer.co.nz/support/contact-us/index -> HTTP/2.0 200 (3094 bytes)
65
- GET https://www.oriontransfer.co.nz/products/library-inspector/index -> HTTP/2.0 200 (5592 bytes)
66
- GET https://www.oriontransfer.co.nz/products/truth-tables/index -> HTTP/2.0 200 (4160 bytes)
67
- GET https://www.oriontransfer.co.nz/products/fingerprint/index -> HTTP/2.0 200 (4414 bytes)
68
- GET https://www.oriontransfer.co.nz/services/internet-services -> HTTP/2.0 200 (3362 bytes)
69
- GET https://www.oriontransfer.co.nz/services/software-development -> HTTP/2.0 200 (3521 bytes)
70
- GET https://www.oriontransfer.co.nz/services/systems-administration -> HTTP/2.0 200 (2979 bytes)
71
- GET https://www.oriontransfer.co.nz/services/website-development -> HTTP/2.0 200 (3943 bytes)
72
- HEAD https://www.oriontransfer.co.nz/_gallery/products/library-inspector/_screenshots/large/Library%20Inspector%20(Libraries).png -> HTTP/2.0 200 (unspecified bytes)
73
- Unsupported content type: image/png
74
- HEAD https://www.oriontransfer.co.nz/_gallery/products/library-inspector/_screenshots/large/Library%20Inspector%20(Libraries%20Disassembly).png -> HTTP/2.0 200 (unspecified bytes)
75
- Unsupported content type: image/png
76
- HEAD https://www.oriontransfer.co.nz/_gallery/products/library-inspector/_screenshots/large/Library%20Inspector%20(Libraries%20QuickLook).png -> HTTP/2.0 200 (unspecified bytes)
77
- Unsupported content type: image/png
78
- HEAD https://www.oriontransfer.co.nz/_gallery/products/library-inspector/_screenshots/large/Library%20Inspector%20(App).png -> HTTP/2.0 200 (unspecified bytes)
79
- Unsupported content type: image/png
80
- HEAD https://www.oriontransfer.co.nz/_gallery/products/library-inspector/_screenshots/large/Library%20Inspector%20(App%20Headers).png -> HTTP/2.0 200 (unspecified bytes)
81
- Unsupported content type: image/png
82
- HEAD https://www.oriontransfer.co.nz/_gallery/products/truth-tables/_screenshots/large/Reformat%20Expression.png -> HTTP/2.0 200 (unspecified bytes)
83
- Unsupported content type: image/png
84
- HEAD https://www.oriontransfer.co.nz/_gallery/products/truth-tables/_screenshots/large/Large%20Tables.png -> HTTP/2.0 200 (unspecified bytes)
85
- Unsupported content type: image/png
86
- HEAD https://www.oriontransfer.co.nz/_gallery/products/truth-tables/_screenshots/large/Tutor.png -> HTTP/2.0 200 (unspecified bytes)
87
- Unsupported content type: image/png
88
- HEAD https://www.oriontransfer.co.nz/_gallery/products/truth-tables/_screenshots/large/Informative%20Text.png -> HTTP/2.0 200 (unspecified bytes)
89
- Unsupported content type: image/png
90
- HEAD https://www.oriontransfer.co.nz/_gallery/products/fingerprint/_screenshots/large/Fingerprint%20(3).png -> HTTP/2.0 200 (unspecified bytes)
91
- Unsupported content type: image/png
92
- HEAD https://www.oriontransfer.co.nz/_gallery/products/fingerprint/_screenshots/large/Fingerprint%20(2).png -> HTTP/2.0 200 (unspecified bytes)
93
- Unsupported content type: image/png
94
- HEAD https://www.oriontransfer.co.nz/_gallery/products/fingerprint/_screenshots/large/Fingerprint%20(1).png -> HTTP/2.0 200 (unspecified bytes)
95
- Unsupported content type: image/png
96
- HEAD https://www.oriontransfer.co.nz/services/training -> HTTP/2.0 200 (unspecified bytes)
97
- GET https://www.oriontransfer.co.nz/services/training (depth = 7)
98
- GET https://www.oriontransfer.co.nz/services/training -> HTTP/2.0 200 (2994 bytes)
99
- 14 samples: 13x 200; 1x 404. 15.12 requests per second. S/D: 35.69ms.
100
- ```
101
-
102
- ### Concurrency
103
-
104
- This benchmark determines the optimal level of concurrency (maximise throughput while keeping latency to a minimum).
105
-
106
- ```shell
107
- $ benchmark-http concurrency https://www.oriontransfer.co.nz/welcome/index
108
- I am going to benchmark https://www.oriontransfer.co.nz/welcome/index...
109
- I am running 1 asynchronous tasks that will each make sequential requests...
110
- I made 273 requests in 52.4s. The per-request latency was 191.79ms. That's 5.214149911737622 asynchronous requests/second.
111
- Variance: 997.437µs
112
- Standard Deviation: 31.58ms
113
- Standard Error: 0.0019114428646174592
114
- I am running 2 asynchronous tasks that will each make sequential requests...
115
- I made 177 requests in 16.8s. The per-request latency was 190.19ms. That's 10.51600772540387 asynchronous requests/second.
116
- Variance: 632.076µs
117
- Standard Deviation: 25.14ms
118
- Standard Error: 0.001889722381767832
119
- I am running 4 asynchronous tasks that will each make sequential requests...
120
- I made 8 requests in 372.49ms. The per-request latency was 186.25ms. That's 21.476841588829895 asynchronous requests/second.
121
- Variance: 0.048µs
122
- Standard Deviation: 219.819µs
123
- Standard Error: 7.771792696588776e-05
124
- I am running 8 asynchronous tasks that will each make sequential requests...
125
- I made 128 requests in 3.0s. The per-request latency was 188.10ms. That's 42.53004421587869 asynchronous requests/second.
126
- Variance: 399.781µs
127
- Standard Deviation: 19.99ms
128
- Standard Error: 0.0017672840585127617
129
- I am running 16 asynchronous tasks that will each make sequential requests...
130
- I made 184 requests in 2.2s. The per-request latency was 188.46ms. That's 84.89938672881854 asynchronous requests/second.
131
- Variance: 548.641µs
132
- Standard Deviation: 23.42ms
133
- Standard Error: 0.0017267724185582615
134
- I am running 32 asynchronous tasks that will each make sequential requests...
135
- I made 152 requests in 891.06ms. The per-request latency was 187.59ms. That's 170.58399627520865 asynchronous requests/second.
136
- Variance: 335.694µs
137
- Standard Deviation: 18.32ms
138
- Standard Error: 0.00148610620533633
139
- I am running 64 asynchronous tasks that will each make sequential requests...
140
- I made 438 requests in 1.3s. The per-request latency was 191.68ms. That's 333.89790173541496 asynchronous requests/second.
141
- Variance: 1.19ms
142
- Standard Deviation: 34.51ms
143
- Standard Error: 0.001648801656177374
144
- I am running 128 asynchronous tasks that will each make sequential requests...
145
- I made 360 requests in 533.83ms. The per-request latency was 189.81ms. That's 674.373540567776 asynchronous requests/second.
146
- Variance: 555.212µs
147
- Standard Deviation: 23.56ms
148
- Standard Error: 0.0012418759009531876
149
- I am running 256 asynchronous tasks that will each make sequential requests...
150
- I made 512 requests in 463.03ms. The per-request latency was 231.51ms. That's 1105.762787139087 asynchronous requests/second.
151
- Variance: 888.185µs
152
- Standard Deviation: 29.80ms
153
- Standard Error: 0.0013170938569343825
154
- I am running 192 asynchronous tasks that will each make sequential requests...
155
- I made 384 requests in 380.97ms. The per-request latency was 190.48ms. That's 1007.9615261872923 asynchronous requests/second.
156
- Variance: 142.770µs
157
- Standard Deviation: 11.95ms
158
- Standard Error: 0.0006097518459132856
159
- I am running 224 asynchronous tasks that will each make sequential requests...
160
- I made 448 requests in 411.79ms. The per-request latency was 205.89ms. That's 1087.9398101463066 asynchronous requests/second.
161
- Variance: 215.480µs
162
- Standard Deviation: 14.68ms
163
- Standard Error: 0.0006935294886115942
164
- I am running 240 asynchronous tasks that will each make sequential requests...
165
- I made 480 requests in 401.62ms. The per-request latency was 200.81ms. That's 1195.1473779597363 asynchronous requests/second.
166
- Variance: 292.021µs
167
- Standard Deviation: 17.09ms
168
- Standard Error: 0.0007799848849992035
169
- I am running 248 asynchronous tasks that will each make sequential requests...
170
- I made 496 requests in 432.58ms. The per-request latency was 216.29ms. That's 1146.621534849607 asynchronous requests/second.
171
- Variance: 446.681µs
172
- Standard Deviation: 21.13ms
173
- Standard Error: 0.0009489813840514241
174
- I am running 252 asynchronous tasks that will each make sequential requests...
175
- I made 504 requests in 417.86ms. The per-request latency was 208.93ms. That's 1206.1477638702509 asynchronous requests/second.
176
- Variance: 222.939µs
177
- Standard Deviation: 14.93ms
178
- Standard Error: 0.0006650854376052381
179
- I am running 254 asynchronous tasks that will each make sequential requests...
180
- I made 508 requests in 419.67ms. The per-request latency was 209.83ms. That's 1210.4835614086478 asynchronous requests/second.
181
- Variance: 177.005µs
182
- Standard Deviation: 13.30ms
183
- Standard Error: 0.0005902836562252991
184
- I am running 255 asynchronous tasks that will each make sequential requests...
185
- I made 510 requests in 434.38ms. The per-request latency was 217.19ms. That's 1174.0936493567908 asynchronous requests/second.
186
- Variance: 457.592µs
187
- Standard Deviation: 21.39ms
188
- Standard Error: 0.000947227304291054
189
- Your server can handle 255 concurrent requests.
190
- At this level of concurrency, requests have ~1.13x higher latency.
191
- ```
192
-
193
- ## Contributing
194
-
195
- 1. Fork it
196
- 2. Create your feature branch (`git checkout -b my-new-feature`)
197
- 3. Commit your changes (`git commit -am 'Add some feature'`)
198
- 4. Push to the branch (`git push origin my-new-feature`)
199
- 5. Create new Pull Request
200
-
201
- ## License
202
-
203
- Released under the MIT license.
204
-
205
- Copyright, 2018, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
206
-
207
- Permission is hereby granted, free of charge, to any person obtaining a copy
208
- of this software and associated documentation files (the "Software"), to deal
209
- in the Software without restriction, including without limitation the rights
210
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
211
- copies of the Software, and to permit persons to whom the Software is
212
- furnished to do so, subject to the following conditions:
213
-
214
- The above copyright notice and this permission notice shall be included in
215
- all copies or substantial portions of the Software.
216
-
217
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
218
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
219
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
220
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
221
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
222
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
223
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,33 +0,0 @@
1
- require_relative "lib/benchmark/http/version"
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "benchmark-http"
5
- spec.version = Benchmark::HTTP::VERSION
6
- spec.authors = ["Samuel Williams"]
7
- spec.email = ["samuel.williams@oriontransfer.co.nz"]
8
-
9
- spec.summary = "An asynchronous benchmark toolbox for modern HTTP servers."
10
- spec.homepage = "https://github.com/socketry/benchmark-http"
11
-
12
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
13
- f.match(%r{^(test|spec|features)/})
14
- end
15
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
- spec.require_paths = ["lib"]
17
-
18
- spec.required_ruby_version = '~> 2.4'
19
-
20
- spec.add_dependency("async-io", "~> 1.5")
21
- spec.add_dependency("async-http", "~> 0.45")
22
- spec.add_dependency("async-await")
23
-
24
- spec.add_dependency("trenni-sanitize")
25
-
26
- spec.add_dependency('samovar', "~> 2.0")
27
-
28
- spec.add_development_dependency "covered"
29
- spec.add_development_dependency "async-rspec"
30
- spec.add_development_dependency "bundler"
31
- spec.add_development_dependency "rake", "~> 10.0"
32
- spec.add_development_dependency "rspec", "~> 3.0"
33
- end