Class: SidekiqVigil::AlertingConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_vigil/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAlertingConfig

Returns a new instance of AlertingConfig.



207
208
209
210
211
212
213
214
215
216
217
# File 'lib/sidekiq_vigil/config.rb', line 207

def initialize
  @pending_cycles = 2
  @cooldown = 600
  @resolve_notice = true
  @flap_window = 120
  @flap_threshold = 4
  @escalate_after = nil
  @group_threshold = 5
  @group_top_n = 5
  @mutes = []
end

Instance Attribute Details

#cooldownObject

Returns the value of attribute cooldown.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def cooldown
  @cooldown
end

#escalate_afterObject

Returns the value of attribute escalate_after.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def escalate_after
  @escalate_after
end

#flap_thresholdObject

Returns the value of attribute flap_threshold.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def flap_threshold
  @flap_threshold
end

#flap_windowObject

Returns the value of attribute flap_window.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def flap_window
  @flap_window
end

#group_thresholdObject

Returns the value of attribute group_threshold.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def group_threshold
  @group_threshold
end

#group_top_nObject

Returns the value of attribute group_top_n.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def group_top_n
  @group_top_n
end

#mutesObject

Returns the value of attribute mutes.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def mutes
  @mutes
end

#pending_cyclesObject

Returns the value of attribute pending_cycles.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def pending_cycles
  @pending_cycles
end

#resolve_noticeObject

Returns the value of attribute resolve_notice.



204
205
206
# File 'lib/sidekiq_vigil/config.rb', line 204

def resolve_notice
  @resolve_notice
end

Instance Method Details

#to_hObject



226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/sidekiq_vigil/config.rb', line 226

def to_h
  {
    pending_cycles: pending_cycles,
    cooldown: cooldown,
    resolve_notice: resolve_notice,
    flap_window: flap_window,
    flap_threshold: flap_threshold,
    escalate_after: escalate_after,
    group_threshold: group_threshold,
    group_top_n: group_top_n,
    mutes: mutes
  }
end

#validate!Object



219
220
221
222
223
224
# File 'lib/sidekiq_vigil/config.rb', line 219

def validate!
  validate_numeric_fields!
  validate_escalation!
  mutes.each { |mute| validate_mute!(mute) }
  self
end