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


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

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


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

def start
  ObjectSpace.count_objects
end