benchmark-http 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/benchmark/http/spider.rb +8 -3
- data/lib/benchmark/http/statistics.rb +1 -1
- data/lib/benchmark/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ef251d13a8e0a6c8966d03056203fb57b465f5a110f602fabd208232f06cd69
|
4
|
+
data.tar.gz: fabf1b8be4f2f21a74dd8a626c9a2d1d99bed5e6eb6161b49ae629c19b24790e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c61036734fbd5642c63ced591f049d77cf37a6849953f80150000b2c3d318d5a700d90ccc238d23793700dc27909a1dc37ed01e7d1924af6ebca8e0d931f984
|
7
|
+
data.tar.gz: a8a0ae66402b1bf147bcab1af6ab2a73d7cf0654ea345466ec9baa972ccc87cbe6a7c5d426869e334de92f31cefbe07fdf1a41b67aea6df42b174a2d47add62a
|
@@ -71,7 +71,12 @@ module Benchmark
|
|
71
71
|
end
|
72
72
|
|
73
73
|
async def fetch(statistics, client, url, depth = @depth, fetched = Set.new, &block)
|
74
|
-
|
74
|
+
if depth.zero?
|
75
|
+
Async.logger.warn(self) {"Exceeded depth while trying to visit #{url}!"}
|
76
|
+
return
|
77
|
+
elsif fetched.include?(url)
|
78
|
+
return
|
79
|
+
end
|
75
80
|
|
76
81
|
fetched << url
|
77
82
|
|
@@ -84,11 +89,11 @@ module Benchmark
|
|
84
89
|
if response.redirection?
|
85
90
|
location = url + response.headers['location']
|
86
91
|
if location.host == url.host
|
87
|
-
Async.logger.
|
92
|
+
Async.logger.debug(self) {"Following redirect to #{location}..."}
|
88
93
|
fetch(statistics, client, location, depth-1, fetched, &block).wait
|
89
94
|
return
|
90
95
|
else
|
91
|
-
Async.logger.
|
96
|
+
Async.logger.debug(self) {"Ignoring redirect to #{location}."}
|
92
97
|
return
|
93
98
|
end
|
94
99
|
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.11.
|
4
|
+
version: 0.11.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: 2020-01-
|
11
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|