benchmark_driver 0.15.12 → 0.15.13
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/runner/ips.rb +16 -10
- data/lib/benchmark_driver/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: 2ae35c25d0a6bd2e2c5d5e04522c81fb99f020d4e53cd0ecb67964cdef95460c
|
4
|
+
data.tar.gz: 8af270bebabda4f1da320542a46f4ab4cee421a024996b9ddf6b46a2da7ff354
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a0c0f81f4e0f5854eb10c139dfbe94e90993239121a318007567a7edcb6193cf5fe455dfe6b41223bd5244b754c56579604d3b67e0599385c897ff9d268fca1
|
7
|
+
data.tar.gz: f0b8927b886d57f43b6bdd48958e12f6c7870713b60a64f36ea5c04b3d89722c718c1057a59b3e2d0aa77a1609d8ad9cd193b241ec0ebb10f68a78bea3ea7209
|
data/CHANGELOG.md
CHANGED
@@ -107,8 +107,8 @@ class BenchmarkDriver::Runner::Ips
|
|
107
107
|
|
108
108
|
duration = Tempfile.open(['benchmark_driver-', '.rb']) do |f|
|
109
109
|
with_script(benchmark.render(result: f.path)) do |path|
|
110
|
-
|
111
|
-
if
|
110
|
+
success = execute(*context.executable.command, path, exception: false)
|
111
|
+
if success && ((value = Float(f.read)) > 0)
|
112
112
|
value
|
113
113
|
else
|
114
114
|
BenchmarkDriver::Result::ERROR
|
@@ -137,10 +137,7 @@ class BenchmarkDriver::Runner::Ips
|
|
137
137
|
end
|
138
138
|
|
139
139
|
def with_script(script)
|
140
|
-
if @config.verbose >= 2
|
141
|
-
sep = '-' * 30
|
142
|
-
$stdout.puts "\n\n#{sep}[Script begin]#{sep}\n#{script}#{sep}[Script end]#{sep}\n\n"
|
143
|
-
end
|
140
|
+
debug_output('Script', script) if @config.verbose >= 2
|
144
141
|
|
145
142
|
Tempfile.open(['benchmark_driver-', '.rb']) do |f|
|
146
143
|
f.puts script
|
@@ -149,11 +146,20 @@ class BenchmarkDriver::Runner::Ips
|
|
149
146
|
end
|
150
147
|
end
|
151
148
|
|
152
|
-
def execute(*args)
|
153
|
-
|
154
|
-
|
155
|
-
|
149
|
+
def execute(*args, exception: true)
|
150
|
+
$stderr.puts "$ #{args.shelljoin}" if @config.verbose >= 2
|
151
|
+
|
152
|
+
stdout = IO.popen(args, &:read)
|
153
|
+
debug_output('Command output', stdout) if @config.verbose >= 2
|
154
|
+
if exception && !$?.success?
|
155
|
+
raise "Failed to execute: #{args.shelljoin} (status: #{$?})"
|
156
156
|
end
|
157
|
+
$?.success?
|
158
|
+
end
|
159
|
+
|
160
|
+
def debug_output(name, text)
|
161
|
+
sep = '-' * 30
|
162
|
+
$stdout.puts "\n\n#{sep}[#{name} begin]#{sep}\n#{text}#{sep}[#{name} end]#{sep}\n\n"
|
157
163
|
end
|
158
164
|
|
159
165
|
WarmupScript = ::BenchmarkDriver::Struct.new(:preludes, :script, :teardown, :loop_count, :first_warmup_duration, :second_warmup_duration) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benchmark_driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|