benchmark-http 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/benchmark-http.gemspec +2 -2
- data/bin/benchmark-http +1 -1
- data/lib/benchmark/http/command.rb +12 -11
- data/lib/benchmark/http/command/concurrency.rb +3 -3
- data/lib/benchmark/http/command/spider.rb +3 -3
- data/lib/benchmark/http/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ff28ada0eec1dced43b0381dcd1c81130a6ec6f6225f8680e1ea0178bc735f0
|
4
|
+
data.tar.gz: a56465b61af11a0ea0caf2bd072af4aca74ec1dd0dd74cbb516c0d7d1f237eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f329c0b4ee5250a6a67b278b1083502e78cf615fa000ba1ead3067ced2c41291b856196f069216db0d92ab2e38b20ec3116a361da1fbae52840bf25ba99b7a80
|
7
|
+
data.tar.gz: 8af88a24ef3e4815046f15fb292f925b78e8d55f7c78259bac460fa34837a105d9a9e96625d64563be938d8f34f84e11180df5d76262b64f54e414a875da04d7
|
data/benchmark-http.gemspec
CHANGED
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.required_ruby_version = '~> 2.4'
|
19
19
|
|
20
20
|
spec.add_dependency("async-io", "~> 1.5")
|
21
|
-
spec.add_dependency("async-http", "~> 0.
|
21
|
+
spec.add_dependency("async-http", "~> 0.45")
|
22
22
|
spec.add_dependency("async-await")
|
23
23
|
|
24
24
|
spec.add_dependency("trenni-sanitize")
|
25
25
|
|
26
|
-
spec.add_dependency('samovar', "~>
|
26
|
+
spec.add_dependency('samovar', "~> 2.0")
|
27
27
|
|
28
28
|
spec.add_development_dependency "bundler"
|
29
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/bin/benchmark-http
CHANGED
@@ -27,8 +27,8 @@ require 'samovar'
|
|
27
27
|
module Benchmark
|
28
28
|
module HTTP
|
29
29
|
module Command
|
30
|
-
def self.
|
31
|
-
Top.
|
30
|
+
def self.call(*args)
|
31
|
+
Top.call(*args)
|
32
32
|
end
|
33
33
|
|
34
34
|
class Top < Samovar::Command
|
@@ -40,9 +40,10 @@ module Benchmark
|
|
40
40
|
option '-v/--version', "Print out the application version."
|
41
41
|
end
|
42
42
|
|
43
|
-
nested
|
43
|
+
nested :command, {
|
44
44
|
'concurrency' => Concurrency,
|
45
45
|
'spider' => Spider
|
46
|
+
}
|
46
47
|
|
47
48
|
def verbose?
|
48
49
|
@options[:logging] == :verbose
|
@@ -52,21 +53,21 @@ module Benchmark
|
|
52
53
|
@options[:logging] == :quiet
|
53
54
|
end
|
54
55
|
|
55
|
-
def
|
56
|
+
def call
|
56
57
|
if verbose?
|
57
|
-
Async.logger.
|
58
|
+
Async.logger.debug!
|
58
59
|
elsif quiet?
|
59
|
-
Async.logger.
|
60
|
+
Async.logger.warn!
|
60
61
|
else
|
61
|
-
Async.logger.
|
62
|
+
Async.logger.info!
|
62
63
|
end
|
63
64
|
|
64
65
|
if @options[:version]
|
65
|
-
puts "
|
66
|
-
elsif @options[:help]
|
67
|
-
print_usage
|
66
|
+
puts "#{self.name} v#{VERSION}"
|
67
|
+
elsif @options[:help]
|
68
|
+
self.print_usage
|
68
69
|
else
|
69
|
-
@command.
|
70
|
+
@command.call
|
70
71
|
end
|
71
72
|
end
|
72
73
|
end
|
@@ -23,7 +23,7 @@ require_relative '../statistics'
|
|
23
23
|
|
24
24
|
require 'async'
|
25
25
|
require 'async/http/client'
|
26
|
-
require 'async/http/
|
26
|
+
require 'async/http/endpoint'
|
27
27
|
|
28
28
|
require 'samovar'
|
29
29
|
|
@@ -74,7 +74,7 @@ module Benchmark
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def run(url)
|
77
|
-
endpoint = Async::HTTP::
|
77
|
+
endpoint = Async::HTTP::Endpoint.parse(url)
|
78
78
|
request_path = endpoint.url.request_uri
|
79
79
|
|
80
80
|
puts "I am going to benchmark #{url}..."
|
@@ -116,7 +116,7 @@ module Benchmark
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
def
|
119
|
+
def call
|
120
120
|
@hosts.each do |host|
|
121
121
|
run(host).wait
|
122
122
|
end
|
@@ -24,7 +24,7 @@ require_relative '../links_filter'
|
|
24
24
|
|
25
25
|
require 'async'
|
26
26
|
require 'async/http/client'
|
27
|
-
require 'async/http/
|
27
|
+
require 'async/http/endpoint'
|
28
28
|
require 'async/await'
|
29
29
|
|
30
30
|
require 'samovar'
|
@@ -125,11 +125,11 @@ module Benchmark
|
|
125
125
|
Async.logger.error($!)
|
126
126
|
end
|
127
127
|
|
128
|
-
async def
|
128
|
+
async def call
|
129
129
|
statistics = Statistics.new
|
130
130
|
|
131
131
|
@urls.each do |url|
|
132
|
-
endpoint = Async::HTTP::
|
132
|
+
endpoint = Async::HTTP::Endpoint.parse(url, timeout: 10)
|
133
133
|
|
134
134
|
Async::HTTP::Client.open(endpoint, endpoint.protocol, connection_limit: 4) do |client|
|
135
135
|
fetch(statistics, client, endpoint.url).wait
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benchmark-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: '0.45'
|
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.
|
40
|
+
version: '0.45'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: async-await
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
|
-
rubygems_version: 3.0.
|
168
|
+
rubygems_version: 3.0.3
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: An asynchronous benchmark toolbox for modern HTTP servers.
|