benchmark_driver 0.14.5 → 0.14.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/exe/benchmark-driver +27 -26
- data/lib/benchmark_driver/config.rb +2 -0
- data/lib/benchmark_driver/runner.rb +4 -6
- 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: 35017290d925f5c26a003c0110768c477f813200cabacca2bdb6b7f1920dbdc0
|
4
|
+
data.tar.gz: 8902078f79879de35e13654710f25048d601c09ff6fd07a6f34de59d9d01c518
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d94cdef0fa82b088c5d15fb697f4f555223183b263a7a69622849ddb31f0281658a062dfe00fad56fae5a6761e3d2ddb0d70137ea8c330ccad3b0a506cc7d9e
|
7
|
+
data.tar.gz: 03c250fd66144397b636a40b8437cdce619be12b084f4a441727840c79e339ddd88c82bfd0f4558672e65bc6f6ed3e0f885b8feb9314cf0e211a83ad6edfc751
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# v0.14.6
|
2
|
+
|
3
|
+
- Improve option parser validation
|
4
|
+
- Add `--timeout` option only for Linux having timeout(1)
|
5
|
+
- Support `--version` option
|
6
|
+
- Fix help output for `-e`/`--rbenv` in benchmark-driver command
|
7
|
+
|
1
8
|
# v0.14.5
|
2
9
|
|
3
10
|
- Fix wrong spacing format in simple / markdown output
|
data/exe/benchmark-driver
CHANGED
@@ -10,18 +10,18 @@ require 'yaml'
|
|
10
10
|
config = BenchmarkDriver::Config.new.tap do |c|
|
11
11
|
executables = []
|
12
12
|
bundler = false
|
13
|
+
timeout = false
|
14
|
+
|
13
15
|
parser = OptionParser.new do |o|
|
14
|
-
o.
|
15
|
-
o.
|
16
|
-
|
16
|
+
o.version = BenchmarkDriver::VERSION
|
17
|
+
o.banner = "Usage: #{File.basename($0, '.*')} [options] RUBY|YAML..."
|
18
|
+
o.on('-r', '--runner TYPE', String, 'Specify runner type: ips, time, memory, once (default: ips)') do |d|
|
17
19
|
c.runner_type = d
|
18
20
|
end
|
19
|
-
o.on('-o', '--output
|
20
|
-
abort '-o, --output must take argument but not given' if out.nil?
|
21
|
+
o.on('-o', '--output TYPE', String, 'Specify output type: compare, simple, markdown, record (default: compare)') do |out|
|
21
22
|
c.output_type = out
|
22
23
|
end
|
23
|
-
o.on('-e', '--executables
|
24
|
-
abort '--executable must take argument but not given' if e.nil?
|
24
|
+
o.on('-e', '--executables EXECS', String, 'Ruby executables (e1::path1 arg1; e2::path2 arg2;...)') do |e|
|
25
25
|
e.split(';').each do |name_path|
|
26
26
|
name, path = name_path.split('::', 2)
|
27
27
|
path ||= name # if `::` is not given, regard whole string as path
|
@@ -30,20 +30,15 @@ config = BenchmarkDriver::Config.new.tap do |c|
|
|
30
30
|
executables << BenchmarkDriver::Config::Executable.new(name: name, command: command)
|
31
31
|
end
|
32
32
|
end
|
33
|
-
o.on('--rbenv
|
34
|
-
abort '--rbenv must take argument but not given' if r.nil?
|
33
|
+
o.on('--rbenv VERSIONS', String, 'Ruby executables in rbenv (x.x.x arg1;y.y.y arg2;...)') do |r|
|
35
34
|
r.split(';').each do |version|
|
36
35
|
executables << BenchmarkDriver::Rbenv.parse_spec(version)
|
37
36
|
end
|
38
37
|
end
|
39
|
-
o.on('--repeat-count
|
40
|
-
|
41
|
-
c.repeat_count = Integer(v)
|
42
|
-
rescue ArgumentError
|
43
|
-
abort "-r, --repeat-count must take Integer, but got #{v.inspect}"
|
44
|
-
end
|
38
|
+
o.on('--repeat-count NUM', Integer, 'Try benchmark NUM times and use the fastest result or the worst memory usage') do |v|
|
39
|
+
c.repeat_count = v
|
45
40
|
end
|
46
|
-
o.on('--repeat-result
|
41
|
+
o.on('--repeat-result TYPE', String, 'Yield "best", "average" or "worst" result with --repeat-count (default: best)') do |v|
|
47
42
|
unless BenchmarkDriver::Repeater::VALID_TYPES.include?(v)
|
48
43
|
raise ArgumentError.new("--repeat-result must be #{BenchmarkDriver::Repeater::VALID_TYPES.join(', ')} but got #{v.inspect}")
|
49
44
|
end
|
@@ -52,21 +47,24 @@ config = BenchmarkDriver::Config.new.tap do |c|
|
|
52
47
|
o.on('--bundler', 'Install and use gems specified in Gemfile') do |v|
|
53
48
|
bundler = v
|
54
49
|
end
|
55
|
-
o.on('--filter
|
50
|
+
o.on('--filter REGEXP', String, 'Filter out benchmarks with given regexp') do |v|
|
56
51
|
c.filters << Regexp.compile(v)
|
57
52
|
end
|
58
|
-
o.on('--run-duration
|
59
|
-
|
60
|
-
c.run_duration = Float(v)
|
61
|
-
rescue ArgumentError
|
62
|
-
abort "--run-duration must take Float, but got #{v.inspect}"
|
63
|
-
end
|
53
|
+
o.on('--run-duration SECONDS', Float, 'Warmup estimates loop_count to run for this duration (default: 3)') do |v|
|
54
|
+
c.run_duration = v
|
64
55
|
end
|
56
|
+
o.on('--timeout SECONDS', Float, 'Timeout ruby command execution with timeout(1)') do |v|
|
57
|
+
timeout = v
|
58
|
+
end if (os = RbConfig::CONFIG['host_os']) && os.match(/linux/) && system('which timeout > /dev/null') # depending on coreutils for now...
|
65
59
|
o.on('-v', '--verbose', 'Verbose mode. Multiple -v options increase visilibity (max: 2)') do |v|
|
66
60
|
c.verbose += 1
|
67
61
|
end
|
68
62
|
end
|
69
|
-
|
63
|
+
begin
|
64
|
+
c.paths = parser.parse!(ARGV)
|
65
|
+
rescue OptionParser::InvalidArgument => e
|
66
|
+
abort e.message
|
67
|
+
end
|
70
68
|
if c.paths.empty?
|
71
69
|
abort "No YAML file is specified!\n\n#{parser.help}"
|
72
70
|
end
|
@@ -75,10 +73,13 @@ config = BenchmarkDriver::Config.new.tap do |c|
|
|
75
73
|
unless executables.empty?
|
76
74
|
c.executables = executables
|
77
75
|
end
|
78
|
-
|
79
|
-
|
76
|
+
c.executables.each do |exec|
|
77
|
+
if bundler
|
80
78
|
exec.command << '-rbundler/setup'
|
81
79
|
end
|
80
|
+
if timeout
|
81
|
+
exec.command = ['timeout', timeout.to_s, *exec.command]
|
82
|
+
end
|
82
83
|
end
|
83
84
|
|
84
85
|
c.freeze
|
@@ -11,6 +11,7 @@ module BenchmarkDriver
|
|
11
11
|
:repeat_count, # @param [Integer]
|
12
12
|
:repeat_result, # @param [String]
|
13
13
|
:run_duration, # @param [Float]
|
14
|
+
:timeout, # @param [Float,nil]
|
14
15
|
:verbose, # @param [Integer]
|
15
16
|
defaults: {
|
16
17
|
runner_type: 'ips',
|
@@ -28,6 +29,7 @@ module BenchmarkDriver
|
|
28
29
|
:repeat_count, # @param [Integer]
|
29
30
|
:repeat_result, # @param [String]
|
30
31
|
:run_duration, # @param [Float]
|
32
|
+
:timeout, # @param [Float,nil]
|
31
33
|
:verbose, # @param [Integer]
|
32
34
|
)
|
33
35
|
|
@@ -20,12 +20,10 @@ module BenchmarkDriver
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
runner_config = Config::RunnerConfig.new
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
verbose: config.verbose,
|
28
|
-
)
|
23
|
+
runner_config = Config::RunnerConfig.new
|
24
|
+
runner_config.members.each do |member|
|
25
|
+
runner_config[member] = config[member]
|
26
|
+
end
|
29
27
|
|
30
28
|
jobs.group_by{ |j| j.respond_to?(:contexts) && j.contexts }.each do |contexts, contexts_jobs|
|
31
29
|
contexts_jobs.group_by(&:metrics).each do |metrics, metrics_jobs|
|
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.14.
|
4
|
+
version: 0.14.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|