Class: Contrast::Components::HeapDump::Interface
- 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
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
- #canon_name ⇒ String readonly
- #config_values ⇒ Array readonly
Instance Method Summary collapse
-
#clean ⇒ Boolean, String
Remove temporary objects or not.
-
#count ⇒ Integer, DEFAULT_COUNT
Number of dumps to take.
-
#delay_ms ⇒ Integer, DEFAULT_MS
Time, in ms, after initialization.
-
#enable ⇒ Boolean, String
Should dumps be taken.
-
#initialize(hsh = {}) ⇒ Interface
constructor
A new instance of Interface.
-
#path ⇒ String, DEFAULT_PATH
Dir to which dumps should be.
-
#window_ms ⇒ Integer, DEFAULT_MS
Ms between each dump.
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
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_name ⇒ String (readonly)
16 17 18 |
# File 'lib/contrast/components/heap_dump.rb', line 16 def canon_name @canon_name end |
#config_values ⇒ Array (readonly)
18 19 20 |
# File 'lib/contrast/components/heap_dump.rb', line 18 def config_values @config_values end |
Instance Method Details
#clean ⇒ Boolean, String
Returns 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 |
#count ⇒ Integer, DEFAULT_COUNT
Returns number of dumps to take.
60 61 62 |
# File 'lib/contrast/components/heap_dump.rb', line 60 def count @_count ||= DEFAULT_COUNT end |
#delay_ms ⇒ Integer, DEFAULT_MS
Returns 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 |
#enable ⇒ Boolean, String
Returns 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 |
#path ⇒ String, DEFAULT_PATH
Returns dir to which dumps should be.
45 46 47 |
# File 'lib/contrast/components/heap_dump.rb', line 45 def path @_path ||= DEFAULT_PATH end |
#window_ms ⇒ Integer, DEFAULT_MS
Returns ms between each dump.
55 56 57 |
# File 'lib/contrast/components/heap_dump.rb', line 55 def window_ms @_window_ms ||= DEFAULT_MS end |