Class: Bixby::Bench::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/bixby/bench/report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allocation_statsObject

Returns the value of attribute allocation_stats.



5
6
7
# File 'lib/bixby/bench/report.rb', line 5

def allocation_stats
  @allocation_stats
end

#tmsObject

Returns the value of attribute tms.



5
6
7
# File 'lib/bixby/bench/report.rb', line 5

def tms
  @tms
end

Instance Method Details



7
8
9
10
11
12
13
14
15
16
# File 'lib/bixby/bench/report.rb', line 7

def print
  if @allocation_stats then
    format = Benchmark::FORMAT.gsub(/\n$/, '') + " %16d %12d\n"
    allocations = allocation_stats.allocations.all.size
    memsize = allocation_stats.allocations.bytes.to_a.inject(&:+)
    puts @tms.format(format, allocations, memsize)
  else
    puts @tms
  end
end