Class: HeapInspect::CLI
- Inherits:
-
Object
- Object
- HeapInspect::CLI
- Defined in:
- lib/heap_inspect.rb
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize(argv) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ CLI
Returns a new instance of CLI.
8 9 10 11 12 13 |
# File 'lib/heap_inspect.rb', line 8 def initialize(argv) @cmd = argv.shift @file = argv.shift @number = argv.shift @args = argv end |
Instance Method Details
#help ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/heap_inspect.rb', line 15 def help puts <<-HALP $ heap_inspect read <file|command> <number> When run with only a file, it will output the generation and count pairs: $ heap_inspect read tmp/2015-09-30-heap.dump Generation: 0 object count: 209191 Generation: 14 object count: 407 Generation: 15 object count: 638 Generation: 16 object count: 748 Generation: 17 object count: 1023 Generation: 18 object count: 805 When run with a file and a number it will output detailed information for that generation: $ heap_inspect read tmp/2015-09-30-heap.dump 17 Analyzing Heap (Generation: 17) ------------------------------- allocated by memory (in bytes) ============================== /Users/richardschneeman/Documents/projects/codetriage/app/views/layouts/application.html.slim:1 (Memory: 377065, Count: 1 ) /Users/richardschneeman/.gem/ruby/2.2.3/gems/actionview-4.2.3/lib/action_view/template.rb:296 (Memory: 35814, Count: 67 ) /Users/richardschneeman/.gem/ruby/2.2.3/gems/activerecord-4.2.3/lib/active_record/attribute.rb:5 (Memory: 30672, Count: 426 ) HALP end |