Class: Sentry::Cron::MonitorConfig
- Inherits:
-
Object
- Object
- Sentry::Cron::MonitorConfig
- Defined in:
- lib/sentry/cron/monitor_config.rb
Instance Attribute Summary collapse
-
#checkin_margin ⇒ Integer?
How long (in minutes) after the expected checkin time will we wait until we consider the checkin to have been missed.
-
#max_runtime ⇒ Integer?
How long (in minutes) is the checkin allowed to run for in in_progress before it is considered failed.
-
#schedule ⇒ MonitorSchedule::Crontab, MonitorSchedule::Interval
The monitor schedule configuration.
-
#timezone ⇒ String?
tz database style timezone string.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schedule, checkin_margin: nil, max_runtime: nil, timezone: nil) ⇒ MonitorConfig
constructor
A new instance of MonitorConfig.
- #to_hash ⇒ Object
Constructor Details
#initialize(schedule, checkin_margin: nil, max_runtime: nil, timezone: nil) ⇒ MonitorConfig
Returns a new instance of MonitorConfig.
26 27 28 29 30 31 |
# File 'lib/sentry/cron/monitor_config.rb', line 26 def initialize(schedule, checkin_margin: nil, max_runtime: nil, timezone: nil) @schedule = schedule @checkin_margin = checkin_margin @max_runtime = max_runtime @timezone = timezone end |
Instance Attribute Details
#checkin_margin ⇒ Integer?
How long (in minutes) after the expected checkin time will we wait until we consider the checkin to have been missed.
15 16 17 |
# File 'lib/sentry/cron/monitor_config.rb', line 15 def checkin_margin @checkin_margin end |
#max_runtime ⇒ Integer?
How long (in minutes) is the checkin allowed to run for in in_progress before it is considered failed.
20 21 22 |
# File 'lib/sentry/cron/monitor_config.rb', line 20 def max_runtime @max_runtime end |
#schedule ⇒ MonitorSchedule::Crontab, MonitorSchedule::Interval
The monitor schedule configuration
10 11 12 |
# File 'lib/sentry/cron/monitor_config.rb', line 10 def schedule @schedule end |
#timezone ⇒ String?
tz database style timezone string
24 25 26 |
# File 'lib/sentry/cron/monitor_config.rb', line 24 def timezone @timezone end |
Class Method Details
.from_crontab(crontab, **options) ⇒ Object
33 34 35 |
# File 'lib/sentry/cron/monitor_config.rb', line 33 def self.from_crontab(crontab, **) new(MonitorSchedule::Crontab.new(crontab), **) end |
.from_interval(num, unit, **options) ⇒ Object
37 38 39 40 41 |
# File 'lib/sentry/cron/monitor_config.rb', line 37 def self.from_interval(num, unit, **) return nil unless MonitorSchedule::Interval::VALID_UNITS.include?(unit) new(MonitorSchedule::Interval.new(num, unit), **) end |
Instance Method Details
#to_hash ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/sentry/cron/monitor_config.rb', line 43 def to_hash { schedule: schedule.to_hash, checkin_margin: checkin_margin, max_runtime: max_runtime, timezone: timezone }.compact end |