Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9d7ce86b688e
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 08a014e27ee3
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jun 6, 2016

  1. Copy the full SHA
    8db83ea View commit details
  2. Copy the full SHA
    08a014e View commit details
Showing with 15 additions and 1 deletion.
  1. +15 −1 tool/jt.rb
16 changes: 15 additions & 1 deletion tool/jt.rb
Original file line number Diff line number Diff line change
@@ -843,6 +843,7 @@ def can_run_in_heap(heap, *command)
end

def metrics_time(*args)
use_json = args.delete '--json'
samples = []
METRICS_REPS.times do
Utilities.log '.', "sampling\n"
@@ -855,10 +856,23 @@ def metrics_time(*args)
r.close
end
Utilities.log "\n", nil
results = {}
results['human'] = ''
samples[0].each_key do |region|
region_samples = samples.map { |s| s[region] }
mean = region_samples.inject(:+) / samples.size
puts "#{region} #{mean.round(2)} s"
results[region] = mean
if use_json
file = STDERR
else
file = STDOUT
end
human = "#{region} #{mean.round(2)} s\n"
file.print human
results['human'] += human
end
if use_json
puts JSON.generate(Hash[results.map { |key, value| [key.strip, value] }])
end
end