benchmark_driver 0.9.1 → 0.9.2
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/exe/benchmark-driver +7 -0
- data/lib/benchmark_driver/config.rb +3 -0
- data/lib/benchmark_driver/runner.rb +7 -0
- data/lib/benchmark_driver/runner/ips.rb +5 -0
- data/lib/benchmark_driver/runner/memory.rb +5 -0
- data/lib/benchmark_driver/runner/once.rb +5 -0
- 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: d35c947c3b1718ea35b688a22546b6fcc28d6494219791ca9b990571a20ec60b
|
4
|
+
data.tar.gz: 67335dcf0ddb2d881539f6ff7c3f565483a4bf4781829ffe75979276869b34ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d78acc25353ed4d06676671bff54a40256a0d6b90ff543ece4659931d9c775a5496445976a7e3d0ce25326c6164394004b8060a8d7d41def62bc75f7c79a06a
|
7
|
+
data.tar.gz: c8b1e02f00655551d8ff4333ccfa7f887da69dae34902e9f525aeaf37a63633bd480556cb3b3a518941c71824afea28d054b736be81e9fb9ed97fb45c3aac377
|
data/CHANGELOG.md
CHANGED
data/exe/benchmark-driver
CHANGED
@@ -52,6 +52,13 @@ config = BenchmarkDriver::Config.new.tap do |c|
|
|
52
52
|
o.on('--filter [REGEXP]', 'Filter out benchmarks with given regexp') do |v|
|
53
53
|
c.filters << Regexp.compile(v)
|
54
54
|
end
|
55
|
+
o.on('--verbose [LEVEL]', 'Show some verbose outputs: 0, 1, 2 (default: 0)') do |v|
|
56
|
+
begin
|
57
|
+
c.verbose = Integer(v)
|
58
|
+
rescue ArgumentError
|
59
|
+
abort "--verbose must take Integer, but got #{v.inspect}"
|
60
|
+
end
|
61
|
+
end
|
55
62
|
o.on('--run-duration [SECONDS]', 'Warmup esitmates loop_count to run for this duration (default: 3)') do |v|
|
56
63
|
begin
|
57
64
|
c.run_duration = Integer(v)
|
@@ -10,12 +10,14 @@ module BenchmarkDriver
|
|
10
10
|
:filters, # @param [Array<Regexp>]
|
11
11
|
:repeat_count, # @param [Integer]
|
12
12
|
:run_duration, # @param [Integer]
|
13
|
+
:verbose, # @param [Integer]
|
13
14
|
defaults: {
|
14
15
|
runner_type: 'ips',
|
15
16
|
output_type: 'compare',
|
16
17
|
filters: [],
|
17
18
|
repeat_count: 1,
|
18
19
|
run_duration: 3,
|
20
|
+
verbose: 0,
|
19
21
|
},
|
20
22
|
)
|
21
23
|
|
@@ -24,6 +26,7 @@ module BenchmarkDriver
|
|
24
26
|
:executables, # @param [Array<BenchmarkDriver::Config::Executable>]
|
25
27
|
:repeat_count, # @param [Integer]
|
26
28
|
:run_duration, # @param [Integer]
|
29
|
+
:verbose, # @param [Integer]
|
27
30
|
)
|
28
31
|
|
29
32
|
Config::Executable = ::BenchmarkDriver::Struct.new(
|
@@ -11,10 +11,17 @@ module BenchmarkDriver
|
|
11
11
|
# @param [Array<BenchmarkDriver::*::Job>] jobs
|
12
12
|
# @param [BenchmarkDriver::Config] config
|
13
13
|
def run(jobs, config:)
|
14
|
+
if config.verbose >= 1
|
15
|
+
config.executables.each do |exec|
|
16
|
+
$stdout.puts "#{exec.name}: #{IO.popen([*exec.command, '-v'], &:read)}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
14
20
|
runner_config = Config::RunnerConfig.new(
|
15
21
|
executables: config.executables,
|
16
22
|
repeat_count: config.repeat_count,
|
17
23
|
run_duration: config.run_duration,
|
24
|
+
verbose: config.verbose,
|
18
25
|
)
|
19
26
|
|
20
27
|
jobs.group_by(&:class).each do |klass, jobs_group|
|
@@ -124,6 +124,11 @@ class BenchmarkDriver::Runner::Ips
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def with_script(script)
|
127
|
+
if @config.verbose >= 2
|
128
|
+
sep = '-' * 30
|
129
|
+
$stdout.puts "\n\n#{sep}[Script begin]#{sep}\n#{script}#{sep}[Script end]#{sep}\n\n"
|
130
|
+
end
|
131
|
+
|
127
132
|
Tempfile.open(['benchmark_driver-', '.rb']) do |f|
|
128
133
|
f.puts script
|
129
134
|
f.close
|
@@ -86,6 +86,11 @@ class BenchmarkDriver::Runner::Memory
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def with_script(script)
|
89
|
+
if @config.verbose >= 2
|
90
|
+
sep = '-' * 30
|
91
|
+
$stdout.puts "\n\n#{sep}[Script begin]#{sep}\n#{script}#{sep}[Script end]#{sep}\n\n"
|
92
|
+
end
|
93
|
+
|
89
94
|
Tempfile.open(['benchmark_driver-', '.rb']) do |f|
|
90
95
|
f.puts script
|
91
96
|
f.close
|
@@ -68,6 +68,11 @@ class BenchmarkDriver::Runner::Once
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def with_script(script)
|
71
|
+
if @config.verbose >= 2
|
72
|
+
sep = '-' * 30
|
73
|
+
$stdout.puts "\n\n#{sep}[Script begin]#{sep}\n#{script}#{sep}[Script end]#{sep}\n\n"
|
74
|
+
end
|
75
|
+
|
71
76
|
Tempfile.open(['benchmark_driver-', '.rb']) do |f|
|
72
77
|
f.puts script
|
73
78
|
f.close
|