benchmark_driver 0.14.3 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/benchmark_driver/metric.rb +1 -1
- data/lib/benchmark_driver/output/compare.rb +4 -2
- data/lib/benchmark_driver/output/markdown.rb +5 -1
- data/lib/benchmark_driver/output/simple.rb +4 -2
- data/lib/benchmark_driver/runner/ips.rb +1 -1
- data/lib/benchmark_driver/runner/once.rb +1 -1
- data/lib/benchmark_driver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75d01094d334aa05e52228bf11f65ff3a3f13178fb367fba125bdb871769dc4d
|
4
|
+
data.tar.gz: 68fa671585d87f7a3b06d4e15900cc2b565b9a504e7a6bf6fd63ac310104109c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7147d203e882dccb92446fb901839e5450119c4ee65d38c20e025c1f557cf558ace84e066566a316497c097676d4d2276426befdc87e1021bac6bb19cd2d48d3
|
7
|
+
data.tar.gz: c2a431b5c1fa601c0e679125a4c9e5040698f8fb69405270988fbdc1057c6ccb1b350e4164474e5c8197970fff1f6688fff10bd9f3a626b4162747659e7e609d
|
data/CHANGELOG.md
CHANGED
@@ -35,7 +35,7 @@ module BenchmarkDriver
|
|
35
35
|
:environment, # @param [Hash] - Any other key -> value pairs to express the benchmark context
|
36
36
|
defaults: { environment: {} },
|
37
37
|
)
|
38
|
-
Result::ERROR = 0
|
38
|
+
Result::ERROR = 0
|
39
39
|
|
40
40
|
# A kind of thing to be measured
|
41
41
|
Metric = ::BenchmarkDriver::Struct.new(
|
@@ -116,10 +116,12 @@ class BenchmarkDriver::Output::Compare
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def humanize(value, width = 10)
|
119
|
-
if
|
119
|
+
if BenchmarkDriver::Result::ERROR.equal?(value)
|
120
120
|
return " %#{width}s" % 'ERROR'
|
121
|
+
elsif value == 0.0
|
122
|
+
return " %#{width}.3f" % 0.0
|
121
123
|
elsif value < 0
|
122
|
-
raise ArgumentError.new("
|
124
|
+
raise ArgumentError.new("Negative value: #{value.inspect}")
|
123
125
|
end
|
124
126
|
|
125
127
|
scale = (Math.log10(value) / 3).to_i
|
@@ -82,7 +82,11 @@ class BenchmarkDriver::Output::Markdown
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def humanize(value)
|
85
|
-
if value
|
85
|
+
if BenchmarkDriver::Result::ERROR.equal?(value)
|
86
|
+
return " %#{NAME_LENGTH}s" % 'ERROR'
|
87
|
+
elsif value == 0.0
|
88
|
+
return " %#{NAME_LENGTH}.3f" % 0.0
|
89
|
+
elsif value < 0
|
86
90
|
raise ArgumentError.new("Negative value: #{value.inspect}")
|
87
91
|
end
|
88
92
|
|
@@ -77,8 +77,10 @@ class BenchmarkDriver::Output::Simple
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def humanize(value)
|
80
|
-
if
|
81
|
-
return 'ERROR'
|
80
|
+
if BenchmarkDriver::Result::ERROR.equal?(value)
|
81
|
+
return " %#{NAME_LENGTH}s" % 'ERROR'
|
82
|
+
elsif value == 0.0
|
83
|
+
return " %#{NAME_LENGTH}.3f" % 0.0
|
82
84
|
elsif value < 0
|
83
85
|
raise ArgumentError.new("Negative value: #{value.inspect}")
|
84
86
|
end
|
@@ -123,7 +123,7 @@ class BenchmarkDriver::Runner::Ips
|
|
123
123
|
|
124
124
|
# Overridden by BenchmarkDriver::Runner::Time
|
125
125
|
def value_duration(duration:, loop_count:)
|
126
|
-
if
|
126
|
+
if BenchmarkDriver::Result::ERROR.equal?(duration)
|
127
127
|
[BenchmarkDriver::Result::ERROR, BenchmarkDriver::Result::ERROR]
|
128
128
|
else
|
129
129
|
[loop_count.to_f / duration, duration]
|
@@ -35,7 +35,7 @@ class BenchmarkDriver::Runner::Once
|
|
35
35
|
@output.with_job(name: job.name) do
|
36
36
|
job.runnable_contexts(@contexts).each do |context|
|
37
37
|
duration = run_benchmark(job, context: context) # no repeat support
|
38
|
-
if
|
38
|
+
if BenchmarkDriver::Result::ERROR.equal?(duration)
|
39
39
|
value = BenchmarkDriver::Result::ERROR
|
40
40
|
else
|
41
41
|
value = 1.0 / duration
|