Skip to content

Commit

Permalink
Add a last_upgraded field to state
Browse files Browse the repository at this point in the history
This makes it possible to write external monitoring (cf #2)
  • Loading branch information
gdb committed Sep 27, 2012
1 parent b51a7db commit ef647a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion lib/einhorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/einhorn/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef647a5

Please sign in to comment.