Class: Gitlab::Memory::Watchdog::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/memory/watchdog/configuration.rb

Defined Under Namespace

Classes: MonitorStack

Constant Summary collapse

DEFAULT_SLEEP_TIME_SECONDS =
60

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#event_reporterObject



54
55
56
# File 'lib/gitlab/memory/watchdog/configuration.rb', line 54

def event_reporter
  @event_reporter ||= EventReporter.new
end

#handlerObject



50
51
52
# File 'lib/gitlab/memory/watchdog/configuration.rb', line 50

def handler
  @handler ||= Handlers::NullHandler.instance
end

#sleep_time_secondsObject

Used to control the frequency with which the watchdog will wake up and poll the GC.



59
60
61
# File 'lib/gitlab/memory/watchdog/configuration.rb', line 59

def sleep_time_seconds
  @sleep_time_seconds ||= DEFAULT_SLEEP_TIME_SECONDS
end

Instance Method Details

#monitors {|@monitor_stack| ... } ⇒ Object

Yields:

  • (@monitor_stack)


44
45
46
47
48
# File 'lib/gitlab/memory/watchdog/configuration.rb', line 44

def monitors
  @monitor_stack ||= MonitorStack.new
  yield @monitor_stack if block_given?
  @monitor_stack
end