Class: SidekiqVigil::AlertingConfig
- Inherits:
-
Object
- Object
- SidekiqVigil::AlertingConfig
- Defined in:
- lib/sidekiq_vigil/config.rb
Instance Attribute Summary collapse
-
#cooldown ⇒ Object
Returns the value of attribute cooldown.
-
#escalate_after ⇒ Object
Returns the value of attribute escalate_after.
-
#flap_threshold ⇒ Object
Returns the value of attribute flap_threshold.
-
#flap_window ⇒ Object
Returns the value of attribute flap_window.
-
#group_threshold ⇒ Object
Returns the value of attribute group_threshold.
-
#group_top_n ⇒ Object
Returns the value of attribute group_top_n.
-
#mutes ⇒ Object
Returns the value of attribute mutes.
-
#pending_cycles ⇒ Object
Returns the value of attribute pending_cycles.
-
#resolve_notice ⇒ Object
Returns the value of attribute resolve_notice.
Instance Method Summary collapse
-
#initialize ⇒ AlertingConfig
constructor
A new instance of AlertingConfig.
- #to_h ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ AlertingConfig
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
#cooldown ⇒ Object
Returns the value of attribute cooldown.
204 205 206 |
# File 'lib/sidekiq_vigil/config.rb', line 204 def cooldown @cooldown end |
#escalate_after ⇒ Object
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_threshold ⇒ Object
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_window ⇒ Object
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_threshold ⇒ Object
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_n ⇒ Object
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 |
#mutes ⇒ Object
Returns the value of attribute mutes.
204 205 206 |
# File 'lib/sidekiq_vigil/config.rb', line 204 def mutes @mutes end |
#pending_cycles ⇒ Object
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_notice ⇒ Object
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_h ⇒ Object
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 |