Class: Bench::Command::Report

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

Overview

Report benchmarking results as a table

SYNOPSIS

bench #{command_name} [BENCHFILE]

OPTIONS #summarized_options

Instance Method Summary (collapse)

Instance Method Details

- (Object) execute(args)

Raises:

  • (Quickl::InvalidArgument)


38
39
40
41
42
# File 'lib/bench/command/report.rb', line 38

def execute(args)
  raise Quickl::InvalidArgument if args.size > 1
  op = query Alf::Reader.reader(args.first || $stdin)
  Alf::Renderer.text(op).execute($stdout)
end

- (Object) query(op)



29
30
31
32
33
34
35
36
# File 'lib/bench/command/report.rb', line 29

def query(op)
  lispy = Alf.lispy
  op = lispy.summarize(op, @regroup, :measure => lispy.avg{tms})
  @regroup[1..-1].each do |grouping|
    op = lispy.group(op, [grouping] + [:measure], :measure)
  end if @hierarchy 
  op
end