Class: RRDNotifier::AlarmClockDrift

Inherits:
Alarm
  • Object
show all
Defined in:
lib/rrd-grapher/notifier/alarms.rb

Instance Attribute Summary collapse

Attributes inherited from Alarm

#packet

Instance Method Summary collapse

Methods inherited from Alarm

#method_missing

Constructor Details

#initialize(p, allowed_drift) ⇒ AlarmClockDrift

Returns a new instance of AlarmClockDrift.



70
71
72
73
# File 'lib/rrd-grapher/notifier/alarms.rb', line 70

def initialize(p, allowed_drift)
  super(p)
  @allowed_drift = allowed_drift
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RRDNotifier::Alarm

Instance Attribute Details

#allowed_driftObject

difference in seconds between our clock and the one of the host



68
69
70
# File 'lib/rrd-grapher/notifier/alarms.rb', line 68

def allowed_drift
  @allowed_drift
end

Instance Method Details

#is_same?(drift) ⇒ Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/rrd-grapher/notifier/alarms.rb', line 75

def is_same?(drift)
  @allowed_drift == drift
end

#reasonObject



64
# File 'lib/rrd-grapher/notifier/alarms.rb', line 64

def reason; :clock_drift; end