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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af51492a2e3f64bc006048bb0fe4a426f78209b92ca662011ee1060bf8551690
4
- data.tar.gz: 2503cba253b800bb58cdbb8b5516125593f5a7ad84190ef8a8a18fd967557d84
3
+ metadata.gz: 7ff28ada0eec1dced43b0381dcd1c81130a6ec6f6225f8680e1ea0178bc735f0
4
+ data.tar.gz: a56465b61af11a0ea0caf2bd072af4aca74ec1dd0dd74cbb516c0d7d1f237eec
5
5
  SHA512:
6
- metadata.gz: 5516102e012839fc5c8d910ebcfbdd0e0816de5b5dd067bbeeff748622fa4fa4c08e176da4319e6ae2eda13f6aea2e85b6c5338882343ead5d1840190d7cb180
7
- data.tar.gz: 1b29fd8ba7e1bf11553ab143374ba49a23c1d612cc92455c10dc75d5a116660fe34a839d4b7ae20c6326f9c692238ff4b2f9fb4188b2ede4307ce72ae1a402c1
6
+ metadata.gz: f329c0b4ee5250a6a67b278b1083502e78cf615fa000ba1ead3067ced2c41291b856196f069216db0d92ab2e38b20ec3116a361da1fbae52840bf25ba99b7a80
7
+ data.tar.gz: 8af88a24ef3e4815046f15fb292f925b78e8d55f7c78259bac460fa34837a105d9a9e96625d64563be938d8f34f84e11180df5d76262b64f54e414a875da04d7
@@ -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.37.13")
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', "~> 1.3")
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"
@@ -23,6 +23,6 @@
23
23
  require_relative '../lib/benchmark/http'
24
24
 
25
25
  begin
26
- Benchmark::HTTP::Command.parse(ARGV).invoke
26
+ Benchmark::HTTP::Command.call
27
27
  rescue Interrupt
28
28
  end
@@ -27,8 +27,8 @@ require 'samovar'
27
27
  module Benchmark
28
28
  module HTTP
29
29
  module Command
30
- def self.parse(*args)
31
- Top.parse(*args)
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 '<command>',
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 invoke(program_name: File.basename($0))
56
+ def call
56
57
  if verbose?
57
- Async.logger.level = Logger::DEBUG
58
+ Async.logger.debug!
58
59
  elsif quiet?
59
- Async.logger.level = Logger::WARN
60
+ Async.logger.warn!
60
61
  else
61
- Async.logger.level = Logger::INFO
62
+ Async.logger.info!
62
63
  end
63
64
 
64
65
  if @options[:version]
65
- puts "benchmark-http v#{VERSION}"
66
- elsif @options[:help] or @command.nil?
67
- print_usage(program_name)
66
+ puts "#{self.name} v#{VERSION}"
67
+ elsif @options[:help]
68
+ self.print_usage
68
69
  else
69
- @command.invoke(self)
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/url_endpoint'
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::URLEndpoint.parse(url)
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 invoke(parent)
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/url_endpoint'
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 invoke(parent)
128
+ async def call
129
129
  statistics = Statistics.new
130
130
 
131
131
  @urls.each do |url|
132
- endpoint = Async::HTTP::URLEndpoint.parse(url, timeout: 10)
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
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Benchmark
22
22
  module HTTP
23
- VERSION = "0.8.0"
23
+ VERSION = "0.8.1"
24
24
  end
25
25
  end
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.0
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-01-30 00:00:00.000000000 Z
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.37.13
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.37.13
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: '1.3'
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: '1.3'
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.1
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.