Skip to content
Permalink
Browse files

Fixed order of events in timeline when healthchecks are removed

  • Loading branch information...
pierresouchay committed Feb 28, 2019
1 parent 31ef0e1 commit c229564abaf64028a3b193195d38d82f2050fc38
Showing with 14 additions and 2 deletions.
  1. +7 −1 CHANGELOG.md
  2. +1 −1 lib/consul/async/version.rb
  3. +6 −0 samples/consul-ui/timeline.json.erb
@@ -2,10 +2,16 @@

## (UNRELEASED)

IMPROVEMENTS:
## 1.10.1 (February 28, 2019)

BUGFIX:

* Ensure that timeline sort properly events when healthchecks are removed (eg: maintenance)

## 1.10.0 (February 27, 2019)

IMPROVEMENTS:

* new sample [samples/tools/find_all_failing_services.txt.erb](samples/tools/find_all_failing_services.txt.erb)
to find all failing service instances on all DCs very easily.
* Do not report timestamps in metrics.erb as it is toxic for Prometheus
@@ -1,5 +1,5 @@
module Consul
module Async
VERSION = '1.10.0'.freeze
VERSION = '1.10.1'.freeze
end
end
@@ -95,6 +95,12 @@ end
def compute_checks(old_state, cur_state, service_name, instance_name)
old_checks = old_state.dig(service_name, instance_name, 'checks') || {}
new_checks = cur_state.dig(service_name, instance_name, 'checks') || {}
old_index = old_state.dig(service_name, instance_name, 'idx')
# In case of removal of a check (eg: maintenance), Idx might be decreased, ensure it is not
if old_index
new_index = cur_state.dig(service_name, instance_name, 'idx')
cur_state[service_name][instance_name]['idx'] = @newest_index if new_index && new_index < old_index
end
all_checks = Set.new(old_checks.keys + new_checks.keys)
checks = []
all_checks.each do |check_id|

0 comments on commit c229564

Please sign in to comment.
You can’t perform that action at this time.