Class: TestProf::MemoryProf::Printer

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/test_prof/memory_prof/printer.rb,
lib/test_prof/memory_prof/printer/number_to_human.rb

Direct Known Subclasses

AllocPrinter, RssPrinter

Defined Under Namespace

Modules: NumberToHuman

Constant Summary

Constants included from Logging

Logging::COLORS

Instance Method Summary collapse

Methods included from Logging

#log

Constructor Details

#initialize(tracker) ⇒ Printer

Returns a new instance of Printer.



12
13
14
# File 'lib/test_prof/memory_prof/printer.rb', line 12

def initialize(tracker)
  @tracker = tracker
end

Instance Method Details



16
17
18
19
20
21
22
23
24
25
# File 'lib/test_prof/memory_prof/printer.rb', line 16

def print
  messages = [
    "MemoryProf results\n\n",
    print_total,
    print_block("groups", tracker.groups),
    print_block("examples", tracker.examples)
  ]

  log :info, messages.join
end