benchmark_driver 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c01422dfa4032a839397f7151e374767d0596292930e83a132ce934c7734e0b4
4
- data.tar.gz: ef5ddc5dec5813f662e46f6bccc12910ad74279b12e76c4680240973d04b392f
3
+ metadata.gz: 2aa17cc07885ff406870c16844aa57b9230f81a1be2104627af5e21131ba9fb9
4
+ data.tar.gz: 6b3d0dfcc8fe50785811a98eb1d62093a90463150aff7eb7d1773c07a9c72391
5
5
  SHA512:
6
- metadata.gz: c6fc200972891784176499cc685a10c6e823982d004fc1c068cb0beccdaa7eabade24da867f3b72f92c8d2db3af9b33bee1a122262d13a962ee19a2b36d2df20
7
- data.tar.gz: d779167efb7516daba05bdb79b0a332ac6896c7717c70d550a788a7855b50e919d60f7c1ba2ebddfcb857d80bd83e5d716ef6a0807ed373b2065264ef9996f67
6
+ metadata.gz: dc65698d4628c758ec49a32769d9f4e86c1b3d2721777227e7bca285c32b75687e7ec05d93351c4df37ed789e1d96fb0e717fe56440b972e34f03ce04341ca9b
7
+ data.tar.gz: 139315d91d21b9f86a276a3257eec66bdff8f317dd358619d99a6fcdcafabbe9e1fb9a9837b4607f97dbcc2df911b0d11ac128d228c10c644d7336cecbf396e8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.16.1
2
+
3
+ - Add --output-humanize option to --output=simple
4
+
1
5
  # v0.16.0
2
6
 
3
7
  - Support benchmarking inline Ruby scripts [#75](https://github.com/benchmark-driver/benchmark-driver/pull/75)
@@ -1,13 +1,18 @@
1
1
  class BenchmarkDriver::Output::Simple
2
2
  NAME_LENGTH = 10
3
3
 
4
+ OPTIONS = {
5
+ humanize: ['--output-humanize true|false', TrueClass, 'Humanize result numbers (default: true)'],
6
+ }
7
+
4
8
  # @param [Array<BenchmarkDriver::Metric>] metrics
5
9
  # @param [Array<BenchmarkDriver::Job>] jobs
6
10
  # @param [Array<BenchmarkDriver::Context>] contexts
7
- def initialize(metrics:, jobs:, contexts:)
11
+ def initialize(metrics:, jobs:, contexts:, options:)
8
12
  @metrics = metrics
9
13
  @context_names = contexts.map(&:name)
10
14
  @name_length = jobs.map(&:name).map(&:size).max
15
+ @humanize = options.fetch(:humanize, true)
11
16
  end
12
17
 
13
18
  def with_warmup(&block)
@@ -78,6 +83,8 @@ class BenchmarkDriver::Output::Simple
78
83
  end
79
84
 
80
85
  def humanize(value)
86
+ return value unless @humanize
87
+
81
88
  if BenchmarkDriver::Result::ERROR.equal?(value)
82
89
  return " %#{NAME_LENGTH}s" % 'ERROR'
83
90
  elsif value == 0.0
@@ -1,3 +1,3 @@
1
1
  module BenchmarkDriver
2
- VERSION = '0.16.0'
2
+ VERSION = '0.16.1'
3
3
  end
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.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-04 00:00:00.000000000 Z
11
+ date: 2022-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,7 +131,7 @@ homepage: https://github.com/benchmark-driver/benchmark-driver
131
131
  licenses:
132
132
  - MIT
133
133
  metadata: {}
134
- post_install_message:
134
+ post_install_message:
135
135
  rdoc_options: []
136
136
  require_paths:
137
137
  - lib
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubygems_version: 3.3.7
150
- signing_key:
150
+ signing_key:
151
151
  specification_version: 4
152
152
  summary: Fully-featured accurate benchmark driver for Ruby
153
153
  test_files: []