Completed
Push — master ( 28db7c...d39807 )
by Marcelo
01:10
created

Cli.report()   A

Complexity

Conditions 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
1
require 'terminal-table'
2
3
module Koine
4
  class Profiler
5
    module Reporters
6
      class Cli
7
        def initialize(output = STDOUT, table = Terminal::Table.new)
8
          @output = output
9
          @table = table
10
        end
11
12
        def report(entries)
13
          @table << ['Entry', 'Elapsed Time', '# of calls']
14
15
          entries.each do |entry|
16
            @table << [entry.name, entry.elapsed_time, entry.entries.size]
17
          end
18
19
          @output << @table
20
        end
21
      end
22
    end
23
  end
24
end
25