Class: Viiite::Command::Report

Inherits:
Object
  • Object
show all
Includes:
Commons
Defined in:
lib/viiite/command/report.rb

Overview

Report benchmarking results as a table

SYNOPSIS

viiite #{command_name} [BENCHFILE]

OPTIONS #summarized_options

Instance Method Summary collapse

Methods included from Commons

#single_source

Instance Method Details

#execute(argv) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/viiite/command/report.rb', line 59

def execute(argv)
  op = single_source(argv) do |bdb, arg|
    bdb.dataset(arg)
  end
  op = query(op)
  Alf::Renderer.text(op, {:float_format => @ff}).execute($stdout)
end

#query(op) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/viiite/command/report.rb', line 42

def query(op)
  lispy = Alf.lispy
  aggs = {:user   => lispy.avg{tms.utime},
          :system => lispy.avg{tms.stime},
          :total  => lispy.avg{tms.total},
          :real   => lispy.avg{tms.real}}
  aggs[:stddev] = "stddev{ #{@stddev} }" if @stddev
  op = lispy.summarize(op, @regroup, aggs)
  depend = [:user, :system, :total, :real]
  depend += [:stddev] if @stddev
  @regroup[1..-1].reverse.each do |grouping|
    op = lispy.group(op, [grouping] + depend, :measure)
    depend = [:measure]
  end if @hierarchy
  op
end