celluloid-benchmark 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20b4589c9a83f7725c2e07736fc8bdfa4cb4fb37
|
4
|
+
data.tar.gz: 51734ecd91b46e7cbb1aa6472d42bc311ff43110
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29e97639368f9671232d6b02e3cd1b6833c24b238b046956939421a1719f11f6abae9409157ea838d595e33b6c5f3f3bc8222ba732f157bfb68a6618ca40b211
|
7
|
+
data.tar.gz: 6d55dd35f40dc5228b3e8118326d6dcea8d6c9039aad1468558c8b1f5a63701f54c043b5cd9de7c08ec536e1d8f6a1197fa8ffa8c0ed8c311e898a6303f9d525
|
@@ -25,7 +25,11 @@ module CelluloidBenchmark
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def log(http_status_code, start_time, end_time, label, threshold)
|
28
|
-
time =
|
28
|
+
time = 0
|
29
|
+
if start_time && end_time
|
30
|
+
time = end_time - start_time
|
31
|
+
end
|
32
|
+
|
29
33
|
response_times[label] << time
|
30
34
|
response_codes[label] << http_status_code.to_i
|
31
35
|
|
@@ -34,6 +34,10 @@ module CelluloidBenchmark
|
|
34
34
|
Session.run self
|
35
35
|
rescue Mechanize::ResponseCodeError => e
|
36
36
|
log_response_code_error e
|
37
|
+
rescue Errno::ETIMEDOUT => e
|
38
|
+
log_network_error e
|
39
|
+
rescue Net::ReadTimeout => e
|
40
|
+
log_network_error e
|
37
41
|
end
|
38
42
|
|
39
43
|
elapsed_time = Time.now - started_at
|
@@ -111,5 +115,16 @@ module CelluloidBenchmark
|
|
111
115
|
current_request_threshold
|
112
116
|
)
|
113
117
|
end
|
118
|
+
|
119
|
+
def log_network_error(error)
|
120
|
+
self.request_end_time = Time.now
|
121
|
+
benchmark_run.async.log(
|
122
|
+
500,
|
123
|
+
request_start_time,
|
124
|
+
request_end_time,
|
125
|
+
current_request_label,
|
126
|
+
current_request_threshold
|
127
|
+
)
|
128
|
+
end
|
114
129
|
end
|
115
130
|
end
|
@@ -6,6 +6,6 @@ module CelluloidBenchmark
|
|
6
6
|
# Supervised Actor pool of Visitors
|
7
7
|
class VisitorGroup < Celluloid::SupervisionGroup
|
8
8
|
supervise BenchmarkRun, as: :benchmark_run
|
9
|
-
pool Visitor, as: :visitor_pool
|
9
|
+
pool Visitor, as: :visitor_pool, size: Celluloid.cores * 8
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celluloid-benchmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Willson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-07-09 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: celluloid
|