Permalink
Browse files

Add a last_upgraded field to state

This makes it possible to write external monitoring (cf #2)
  • Loading branch information...
1 parent b51a7db commit ef647a5d494cdcfbd90a7ea4809e3e12335c617f @gdb gdb committed Sep 27, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −0 History.txt
  2. +2 −1 lib/einhorn.rb
  3. +1 −0 lib/einhorn/command.rb
View
@@ -12,3 +12,4 @@
* Allow einhorn to signal a given worker multiple times
* Add 'signal' command to Einhornsh
* Add exponential backoff to spinup if new processes are dying before being acked
+* Add last_upgraded field to State
View
@@ -56,7 +56,8 @@ def self.default_state
:socket_path => nil,
:pidfile => nil,
:lockfile => nil,
- :consecutive_deaths_before_ack => 0
+ :consecutive_deaths_before_ack => 0,
+ :last_upgraded => nil
}
end
end
View
@@ -291,6 +291,7 @@ def self.upgrade_workers
# not positive this is the right behavior, but it's not
# obviously wrong.)
Einhorn::State.consecutive_deaths_before_ack = 0
+ Einhorn::State.last_upgraded = Time.now
Einhorn::State.version += 1
replenish_immediately

0 comments on commit ef647a5

Please sign in to comment.