Module: Datadog::Core::Environment::ClassCount

Defined in:
lib/datadog/core/environment/class_count.rb

Overview

Retrieves number of classes from runtime

Class Method Summary collapse

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
# File 'lib/datadog/core/environment/class_count.rb', line 12

def self.available?
  return @class_count_available if defined?(@class_count_available)

  @class_count_available =
    ::ObjectSpace.respond_to?(:count_objects) && ::ObjectSpace.count_objects.key?(:T_CLASS)
end

.valueObject



8
9
10
# File 'lib/datadog/core/environment/class_count.rb', line 8

def self.value
  ::ObjectSpace.count_objects[:T_CLASS]
end