Class: Contrast::Components::HeapDump::Interface

Inherits:
Object
  • Object
show all
Includes:
ComponentBase, Contrast::Config::BaseConfiguration
Defined in:
lib/contrast/components/heap_dump.rb

Overview

Interface used to build the HeapDump settings and component.

Constant Summary collapse

DEFAULT_PATH =

saved

'contrast_heap_dumps'
DEFAULT_MS =
10_000
DEFAULT_COUNT =
5
CANON_NAME =
'agent.heap_dump'
CONFIG_VALUES =
%w[enable path delay_ms window_ms count clean].cs__freeze

Constants included from ComponentBase

ComponentBase::ENABLE

Constants included from Contrast::Config::Diagnostics::Tools

Contrast::Config::Diagnostics::Tools::CHECK

Constants included from Contrast::Config::Diagnostics::SingletonTools

Contrast::Config::Diagnostics::SingletonTools::API_CREDENTIALS, Contrast::Config::Diagnostics::SingletonTools::CONTRAST_MARK

Constants included from Contrast::Config::BaseConfiguration

Contrast::Config::BaseConfiguration::AT_UNDERSCORE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ComponentBase

#false?, #file_exists?, #stringify_array, #to_effective_config, #true?, #valid_cert?

Methods included from Contrast::Config::Diagnostics::Tools

#add_effective_config_values, #add_single_effective_value

Methods included from Contrast::Config::Diagnostics::SingletonTools

#flatten_settings, #to_config_values, #update_config, #value_to_s

Methods included from Contrast::Config::BaseConfiguration

#to_contrast_hash

Constructor Details

#initialize(hsh = {}) ⇒ Interface

Returns a new instance of Interface.



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/contrast/components/heap_dump.rb', line 26

def initialize hsh = {}
  @config_values = CONFIG_VALUES
  @canon_name = CANON_NAME
  return unless hsh

  @_enable = hsh[:enable]
  @_path = hsh[:path]
  @_delay_ms = hsh[:delay_ms]
  @_window_ms = hsh[:window_ms]
  @_count = hsh[:count]
  @_clean = hsh[:clean]
end

Instance Attribute Details

#canon_nameString (readonly)

Returns:



16
17
18
# File 'lib/contrast/components/heap_dump.rb', line 16

def canon_name
  @canon_name
end

#config_valuesArray (readonly)

Returns:

  • (Array)


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

def config_values
  @config_values
end

Instance Method Details

#cleanBoolean, String

Returns remove temporary objects or not.

Returns:

  • (Boolean, String)

    remove temporary objects or not



65
66
67
# File 'lib/contrast/components/heap_dump.rb', line 65

def clean
  @_clean.nil? ? Contrast::Utils::ObjectShare::FALSE : @_clean
end

#countInteger, DEFAULT_COUNT

Returns number of dumps to take.

Returns:



60
61
62
# File 'lib/contrast/components/heap_dump.rb', line 60

def count
  @_count ||= DEFAULT_COUNT
end

#delay_msInteger, DEFAULT_MS

Returns time, in ms, after initialization.

Returns:

  • (Integer, DEFAULT_MS)

    time, in ms, after initialization



50
51
52
# File 'lib/contrast/components/heap_dump.rb', line 50

def delay_ms
  @_delay_ms ||= DEFAULT_MS
end

#enableBoolean, String

Returns should dumps be taken.

Returns:

  • (Boolean, String)

    should dumps be taken



40
41
42
# File 'lib/contrast/components/heap_dump.rb', line 40

def enable
  @_enable.nil? ? Contrast::Utils::ObjectShare::FALSE : @_enable
end

#pathString, DEFAULT_PATH

Returns dir to which dumps should be.

Returns:



45
46
47
# File 'lib/contrast/components/heap_dump.rb', line 45

def path
  @_path ||= DEFAULT_PATH
end

#window_msInteger, DEFAULT_MS

Returns ms between each dump.

Returns:



55
56
57
# File 'lib/contrast/components/heap_dump.rb', line 55

def window_ms
  @_window_ms ||= DEFAULT_MS
end