celluloid-benchmark 0.2.3 → 0.2.4
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: 0af71bfb25b1a44e366ffd32158d870708033fba
|
4
|
+
data.tar.gz: ad4ec7b23af43aa378fefeaa917fc8ca38284b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8105baf1ede2086ccd0717662de81d995bfe8f5654680425411ffa536d5feba76f2e8466ae73843f3f4543652492e8a6c4ac399b844cd9345bb9113668b2107c
|
7
|
+
data.tar.gz: 66dc3c4349ae24c5ebd17df5a0a7f047d23da4ca7c2a6658f98a825381481dd5891e5994ca8856098443f62f22a99d4f722d0424c17c8cbc32fa1ac24aef7230
|
data/bin/celluloid-benchmark
CHANGED
@@ -19,7 +19,7 @@ benchmark_run = CelluloidBenchmark::Runner.run opts.to_hash
|
|
19
19
|
|
20
20
|
puts
|
21
21
|
benchmark_run.benchmarks.sort_by(&:label).each do |trans|
|
22
|
-
puts "#{trans
|
22
|
+
puts "#{CelluloidBenchmark::TextFormatter.status_text(trans)} #{trans.label}"
|
23
23
|
end
|
24
24
|
|
25
25
|
puts
|
@@ -26,6 +26,10 @@ module CelluloidBenchmark
|
|
26
26
|
response_times_ok? && response_codes_ok?
|
27
27
|
end
|
28
28
|
|
29
|
+
def error?
|
30
|
+
!response_codes_ok?
|
31
|
+
end
|
32
|
+
|
29
33
|
# Consider average response time. Do not check for outlying slow times.
|
30
34
|
def response_times_ok?
|
31
35
|
if response_times.size > 0
|
@@ -5,5 +5,15 @@ module CelluloidBenchmark
|
|
5
5
|
def self.to_s(benchmark_run)
|
6
6
|
tp benchmark_run.benchmarks.sort_by(&:label), :label, :threshold, :average_response_time, :min_response_time, :max_response_time, :responses
|
7
7
|
end
|
8
|
+
|
9
|
+
def self.status_text(trans)
|
10
|
+
if trans.ok?
|
11
|
+
"[ OK ]"
|
12
|
+
elsif trans.error?
|
13
|
+
"[ERR ]"
|
14
|
+
else
|
15
|
+
"[FAIL]"
|
16
|
+
end
|
17
|
+
end
|
8
18
|
end
|
9
19
|
end
|