Sha256: 32018e3832b81c04a271f803d54636173b401b18dc1cafa3b732734e98f48699

Contents?: true

Size: 508 Bytes

Versions: 1

Compression:

Stored size: 508 Bytes

Contents

require 'terminal-table'

module Koine
  class Profiler
    module Reporters
      class Cli
        def initialize(output = STDOUT, table = Terminal::Table.new)
          @output = output
          @table = table
        end

        def report(entries)
          @table << ['Entry', 'Elapsed Time', '# of calls']

          entries.each do |entry|
            @table << [entry.name, entry.elapsed_time, entry.entries.size]
          end

          @output << @table
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
koine-profiler-0.1.0 lib/koine/profiler/reporters/cli.rb