Module: Contrast::Components::HeapDump::ClassMethods

Includes:
ComponentBase, Interface
Defined in:
lib/contrast/components/heap_dump.rb

Overview

A wrapper build around the Common Agent Configuration project to allow for access of the values contained in its parent_configuration_spec.yaml. Specifically, this allows for querying the state of the Heap Dump utility.

Instance Method Summary collapse

Methods included from Interface

included

Methods included from ComponentBase

included

Instance Method Details

#heap_dump_controlObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/contrast/components/heap_dump.rb', line 22

def heap_dump_control
  @_heap_dump_control ||= begin
    config = CONFIG.root&.agent&.heap_dump
    {
        enabled: true?(config&.enable),
        path: File.absolute_path(config&.path),
        count: config&.count.to_i || 0,
        window: (config&.window_ms.to_f || 0) / 1000,
        delay: (config&.delay_ms.to_f || 0) / 1000,
        clean: true?(config&.clean)
    }
  end
end

#heap_dump_enabled?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/contrast/components/heap_dump.rb', line 18

def heap_dump_enabled?
  heap_dump_control[:enabled]
end