Class: Puppet::Util::Profiler::ObjectCounts

Inherits:
Logging show all
Defined in:
lib/puppet/util/profiler/object_counts.rb

Instance Method Summary collapse

Methods inherited from Logging

#initialize, #shutdown

Constructor Details

This class inherits a constructor from Puppet::Util::Profiler::Logging

Instance Method Details

#finish(before) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/puppet/util/profiler/object_counts.rb', line 9

def finish(before)
  after = ObjectSpace.count_objects

  diff = before.collect do |type, count|
    [type, after[type] - count]
  end

  diff.sort.collect { |pair| pair.join(': ') }.join(', ')
end

#startObject



5
6
7
# File 'lib/puppet/util/profiler/object_counts.rb', line 5

def start
  ObjectSpace.count_objects
end