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.



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

def initialize(tracker)
  @tracker = tracker
end

Instance Method Details



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

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

  log :info, messages.join
end