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: c2fa39a64f6d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1d1c88645a76
Choose a head ref
  • 4 commits
  • 1 file changed
  • 1 contributor

Commits on May 25, 2016

  1. Copy the full SHA
    480d6a6 View commit details
  2. Copy the full SHA
    c2d2a0e View commit details
  3. Copy the full SHA
    53de4ad View commit details
  4. Copy the full SHA
    1d1c886 View commit details
Showing with 12 additions and 6 deletions.
  1. +12 −6 tool/jt.rb
18 changes: 12 additions & 6 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
# Recommended: function jt { ruby tool/jt.rb "$@"; }

require 'fileutils'
require 'digest/sha1'
require 'json'

GRAALVM_VERSION = "0.11"

@@ -322,7 +322,7 @@ def help
puts 'jt tag all spec/ruby/language tag all specs in this file, without running them'
puts 'jt untag spec/ruby/language untag passing specs in this directory'
puts 'jt untag spec/ruby/language/while_spec.rb untag passing specs in this file'
puts 'jt metrics alloc ... how much memory is allocated running a program (use -X-T to test normal JRuby on this metric and others)'
puts 'jt metrics alloc [--json] ... how much memory is allocated running a program (use -X-T to test normal JRuby on this metric and others)'
puts 'jt metrics minheap ... what is the smallest heap you can use to run an application'
puts 'jt metrics time ... how long does it take to run a command, broken down into different phases'
puts 'jt tarball build the and test the distribution tarball'
@@ -685,6 +685,7 @@ def metrics(command, *args)
end

def metrics_alloc(*args)
use_json = args.delete '--json'
samples = []
METRICS_REPS.times do
log '.', 'sampling'
@@ -696,7 +697,12 @@ def metrics_alloc(*args)
end
log "\n", nil
mean = samples.inject(:+) / samples.size
puts "#{human_size(mean)}, max #{human_size(samples.max)}"
error = samples.max - mean
if use_json
puts JSON.generate({mean: mean, error: error})
else
puts "#{human_size(mean)} ± #{human_size(error)}"
end
end

def memory_allocated(trace)
@@ -819,10 +825,10 @@ def tarball
end

def log(tty_message, full_message)
if STDOUT.tty?
print(tty_message) unless tty_message.nil?
if STDERR.tty?
STDERR.print tty_message unless tty_message.nil?
else
puts full_message unless full_message.nil?
STDERR.puts full_message unless full_message.nil?
end
end