Class: Gitlab::Memory::Watchdog::MonitorState::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(strikes_exceeded:, threshold_violated:, monitor_name:, payload:) ⇒ Result

Returns a new instance of Result.



10
11
12
13
14
15
# File 'lib/gitlab/memory/watchdog/monitor_state.rb', line 10

def initialize(strikes_exceeded:, threshold_violated:, monitor_name:, payload:)
  @strikes_exceeded = strikes_exceeded
  @threshold_violated = threshold_violated
  @monitor_name = monitor_name.to_s.to_sym
  @payload = payload
end

Instance Attribute Details

#monitor_nameObject (readonly)

Returns the value of attribute monitor_name.



8
9
10
# File 'lib/gitlab/memory/watchdog/monitor_state.rb', line 8

def monitor_name
  @monitor_name
end

#payloadObject (readonly)

Returns the value of attribute payload.



8
9
10
# File 'lib/gitlab/memory/watchdog/monitor_state.rb', line 8

def payload
  @payload
end

Instance Method Details

#strikes_exceeded?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/gitlab/memory/watchdog/monitor_state.rb', line 17

def strikes_exceeded?
  @strikes_exceeded
end

#threshold_violated?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/gitlab/memory/watchdog/monitor_state.rb', line 21

def threshold_violated?
  @threshold_violated
end