Class: Stoplight::Domain::Tracker::RecoveryProbe

Inherits:
Object
  • Object
show all
Defined in:
lib/stoplight/domain/tracker/recovery_probe.rb

Instance Method Summary collapse

Constructor Details

#initialize(traffic_recovery:, notifiers:, config:, metrics_store:, state_store:) ⇒ RecoveryProbe

Returns a new instance of RecoveryProbe.



7
8
9
10
11
12
13
# File 'lib/stoplight/domain/tracker/recovery_probe.rb', line 7

def initialize(traffic_recovery:, notifiers:, config:, metrics_store:, state_store:)
  @traffic_recovery = traffic_recovery
  @notifiers = notifiers
  @config = config
  @metrics_store = metrics_store
  @state_store = state_store
end

Instance Method Details

#record_failure(exception) ⇒ Object

Parameters:

  • exception (Exception)


16
17
18
19
20
# File 'lib/stoplight/domain/tracker/recovery_probe.rb', line 16

def record_failure(exception)
  metrics_store.record_failure(exception)

  recover
end

#record_successObject



22
23
24
25
26
# File 'lib/stoplight/domain/tracker/recovery_probe.rb', line 22

def record_success
  metrics_store.record_success

  recover
end