benchmark-http 0.12.0 → 0.15.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: 7a4514dcedbb45217da34b36865cee691f89a314f36e22627f940d6660360a46
4
- data.tar.gz: cc3f73eb0f546ed85abc38ebbe39ad610b0ce6f7d863c4db00e5b0e8cd6346ae
3
+ metadata.gz: 27ea6caaddb5d06fa3e0ed12357c6d39d5ac60cc47c0b30983709a5c8cff3db9
4
+ data.tar.gz: bfca34e7f314b96dc953bebd6c0094ec9672d825e5623087947a0b3b2d03e66e
5
5
  SHA512:
6
- metadata.gz: 56df6b4986db26a1af4e7d5aecfa2f2c71f2140c3139af40903652412b2218a54858503dd67017e97d37a61f132b82c955484dd09fea7f2b4e12ede73b6f0d5f
7
- data.tar.gz: aad17d6df1aa2932484089742f1e0605f9f4bbff09a92717892addf82be72834953c664a22fdeb6b1a69114d2c28d8fff2bf185ddcb3cbaf02d644cfbfa0e46a
6
+ metadata.gz: c837530151c68de4a2b4b9927a5df019472b93e1d544860d8862c0d683845e7bdc7b5d040e06ee90641fd25fbcfee48b113f711b7c98a061ada66c499806e973
7
+ data.tar.gz: 672d38bf11d11426d93d82ad96b94c63bb9eb108530185ecce219d89e47e7462b07db2f6686ae41680a362baba7804cf6b6ee648b50140140838b924920cc1b5
@@ -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)
@@ -34,8 +34,9 @@ module Benchmark
34
34
  class Spider
35
35
  include Async::Await
36
36
 
37
- def initialize(depth: nil)
37
+ def initialize(depth: nil, ignore: nil)
38
38
  @depth = depth
39
+ @ignore = ignore
39
40
  end
40
41
 
41
42
  def extract_links(url, response)
@@ -71,11 +72,13 @@ module Benchmark
71
72
  end
72
73
 
73
74
  async def fetch(statistics, client, url, depth = @depth, fetched = Set.new, &block)
74
- if depth.zero?
75
+ if depth&.zero?
75
76
  Async.logger.warn(self) {"Exceeded depth while trying to visit #{url}!"}
76
77
  return
77
78
  elsif fetched.include?(url)
78
79
  return
80
+ elsif @ignore&.match?(url.path)
81
+ return
79
82
  end
80
83
 
81
84
  fetched << url
@@ -90,7 +93,7 @@ module Benchmark
90
93
  location = url + response.headers['location']
91
94
  if location.host == url.host
92
95
  Async.logger.debug(self) {"Following redirect to #{location}..."}
93
- fetch(statistics, client, location, depth-1, fetched, &block).wait
96
+ fetch(statistics, client, location, depth&.-(1), fetched, &block).wait
94
97
  return
95
98
  else
96
99
  Async.logger.debug(self) {"Ignoring redirect to #{location}."}
@@ -111,7 +114,7 @@ module Benchmark
111
114
  yield("GET", url, response) if block_given?
112
115
 
113
116
  extract_links(url, response) do |href|
114
- fetch(statistics, client, href, depth - 1, fetched, &block)
117
+ fetch(statistics, client, href, depth&.-(1), fetched, &block)
115
118
  end.each(&:wait)
116
119
  rescue Async::TimeoutError
117
120
  Async.logger.error(self) {"Timeout while fetching #{url}"}
@@ -125,7 +128,7 @@ module Benchmark
125
128
  urls.each do |url|
126
129
  endpoint = Async::HTTP::Endpoint.parse(url, timeout: 10)
127
130
 
128
- Async::HTTP::Client.open(endpoint, endpoint.protocol, connection_limit: 4) do |client|
131
+ Async::HTTP::Client.open(endpoint, protocol: endpoint.protocol, connection_limit: 4) do |client|
129
132
  fetch(statistics, client, endpoint.url, &block).wait
130
133
  end
131
134
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Benchmark
22
22
  module HTTP
23
- VERSION = "0.12.0"
23
+ VERSION = "0.15.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.15.0
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-01-31 00:00:00.000000000 Z
11
+ date: 2021-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: async-await
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: async-http
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.54'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.54'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: async-io
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -25,21 +53,21 @@ dependencies:
25
53
  - !ruby/object:Gem::Version
26
54
  version: '1.5'
27
55
  - !ruby/object:Gem::Dependency
28
- name: async-http
56
+ name: samovar
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - "~>"
32
60
  - !ruby/object:Gem::Version
33
- version: '0.45'
61
+ version: '2.0'
34
62
  type: :runtime
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: '0.45'
68
+ version: '2.0'
41
69
  - !ruby/object:Gem::Dependency
42
- name: async-await
70
+ name: trenni-sanitize
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
73
  - - ">="
@@ -53,13 +81,13 @@ dependencies:
53
81
  - !ruby/object:Gem::Version
54
82
  version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
- name: trenni-sanitize
84
+ name: async-rspec
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - ">="
60
88
  - !ruby/object:Gem::Version
61
89
  version: '0'
62
- type: :runtime
90
+ type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
@@ -67,21 +95,21 @@ dependencies:
67
95
  - !ruby/object:Gem::Version
68
96
  version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
- name: samovar
98
+ name: bundler
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
- - - "~>"
101
+ - - ">="
74
102
  - !ruby/object:Gem::Version
75
- version: '2.0'
76
- type: :runtime
103
+ version: '0'
104
+ type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
- - - "~>"
108
+ - - ">="
81
109
  - !ruby/object:Gem::Version
82
- version: '2.0'
110
+ version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
- name: bundler
112
+ name: covered
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
115
  - - ">="
@@ -122,22 +150,13 @@ dependencies:
122
150
  - - "~>"
123
151
  - !ruby/object:Gem::Version
124
152
  version: '3.0'
125
- description:
153
+ description:
126
154
  email:
127
- - samuel.williams@oriontransfer.co.nz
128
155
  executables:
129
156
  - benchmark-http
130
157
  extensions: []
131
158
  extra_rdoc_files: []
132
159
  files:
133
- - ".editorconfig"
134
- - ".gitignore"
135
- - ".rspec"
136
- - ".travis.yml"
137
- - Gemfile
138
- - README.md
139
- - Rakefile
140
- - benchmark-http.gemspec
141
160
  - bin/benchmark-http
142
161
  - lib/benchmark/http.rb
143
162
  - lib/benchmark/http/command.rb
@@ -151,15 +170,16 @@ files:
151
170
  - lib/benchmark/http/statistics.rb
152
171
  - lib/benchmark/http/version.rb
153
172
  homepage: https://github.com/socketry/benchmark-http
154
- licenses: []
173
+ licenses:
174
+ - MIT
155
175
  metadata: {}
156
- post_install_message:
176
+ post_install_message:
157
177
  rdoc_options: []
158
178
  require_paths:
159
179
  - lib
160
180
  required_ruby_version: !ruby/object:Gem::Requirement
161
181
  requirements:
162
- - - "~>"
182
+ - - ">="
163
183
  - !ruby/object:Gem::Version
164
184
  version: '2.4'
165
185
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -168,8 +188,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
188
  - !ruby/object:Gem::Version
169
189
  version: '0'
170
190
  requirements: []
171
- rubygems_version: 3.1.2
172
- signing_key:
191
+ rubygems_version: 3.2.22
192
+ signing_key:
173
193
  specification_version: 4
174
194
  summary: An asynchronous benchmark toolbox for modern HTTP servers.
175
195
  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,31 +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 "bundler"
29
- spec.add_development_dependency "rake", "~> 10.0"
30
- spec.add_development_dependency "rspec", "~> 3.0"
31
- end