lib/flapjack/executive.rb in flapjack-0.6.51 vs lib/flapjack/executive.rb in flapjack-0.6.52
- old
+ new
@@ -166,9 +166,10 @@
@redis.hincrby("event_counters:#{@instance_id}", 'failure', 1)
@redis.hset('unacknowledged_failures', @event_count, event.id)
end
event.previous_state = entity_check.state
+ event.previous_state_duration = Time.now.to_i - entity_check.last_change
@logger.info("No previous state for event #{event.id}") if event.previous_state.nil?
# If there is a state change, update record with: the time, the new state
if event.state != event.previous_state
entity_check.update_state(event.state, :timestamp => timestamp,