sensu 0.25.5 → 0.25.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02d86ad1519a656086b16c960bbca484bb92a4ca
4
- data.tar.gz: da7868c4ce10e396a97630a2888aaad5ce45014d
3
+ metadata.gz: 39c2b42d1f03fb1e40498fdf10de1d9fc5480653
4
+ data.tar.gz: f50b00c57e67d023930a959c8fedf4bc6d9b533b
5
5
  SHA512:
6
- metadata.gz: 217e47e5de21cba8aba1aba6da58a56b87172f55f1ef254529cf29b17faffcff187fefc31ebd822cc92ed2fd5cdd2bf1c5b5cff565ffd39a1e0482b2d0885770
7
- data.tar.gz: 8af3432ae93ab3d5282b4ab717252dbac9bd352cb1663a5f167f026671caf378df03ce2edb2506c64ae5924cd3e13ba76748f6da728d8aa94822ec266419db03
6
+ metadata.gz: 162656e3a8f636a7a7a5c36caea15687e6d0e6181711208c24cb3deafe7cf16ade1fef1e198e392ac73b7f30bf6e34b0da908e5f18c508e5b5a3d4c4cf3cb739
7
+ data.tar.gz: 9adb69483efc57025f13ae328890291ae2b17805a2fbd3c72bec78bd6b60e24f01797f2cd64789b713b9fecd5bec40e770e669a608c7bc18d2eb2b9abd8afa13
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.25.6 - 2016-07-28
2
+
3
+ ### Fixes
4
+
5
+ Check results for unmatched tokens now include an executed timestamp.
6
+
7
+ API aggregates max_age now guards against check results with a `nil`
8
+ executed timestamp.
9
+
1
10
  ## 0.25.5 - 2016-07-12
2
11
 
3
12
  ### Fixes
@@ -58,7 +58,7 @@ module Sensu
58
58
  result_count = results.length
59
59
  timestamp = Time.now.to_i - max_age
60
60
  results.reject! do |result|
61
- result[:executed] < timestamp
61
+ result[:executed] && result[:executed] < timestamp
62
62
  end
63
63
  @response_content[:results][:stale] = result_count - results.length
64
64
  end
@@ -160,7 +160,7 @@ module Sensu
160
160
  unless result_json.nil?
161
161
  result = Sensu::JSON.load(result_json)
162
162
  if SEVERITIES[result[:status]] == severity &&
163
- (max_age.nil? || result[:executed] >= (current_timestamp - max_age))
163
+ (max_age.nil? || result[:executed].nil? || result[:executed] >= (current_timestamp - max_age))
164
164
  summaries[check_name] ||= {}
165
165
  summaries[check_name][result[:output]] ||= {:total => 0, :clients => []}
166
166
  summaries[check_name][result[:output]][:total] += 1
@@ -145,9 +145,9 @@ module Sensu
145
145
  @checks_in_progress << check[:name]
146
146
  substituted, unmatched_tokens = object_substitute_tokens(check.dup)
147
147
  check = substituted.merge(:command => check[:command])
148
+ started = Time.now.to_f
149
+ check[:executed] = started.to_i
148
150
  if unmatched_tokens.empty?
149
- started = Time.now.to_f
150
- check[:executed] = started.to_i
151
151
  Spawn.process(substituted[:command], :timeout => check[:timeout]) do |output, status|
152
152
  check[:duration] = ("%.3f" % (Time.now.to_f - started)).to_f
153
153
  check[:output] = output
@@ -1,7 +1,7 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
3
  # Sensu release version.
4
- VERSION = "0.25.5".freeze
4
+ VERSION = "0.25.6".freeze
5
5
 
6
6
  # Sensu check severities.
7
7
  SEVERITIES = %w[ok warning critical unknown].freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.5
4
+ version: 0.25.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-07-12 00:00:00.000000000 Z
12
+ date: 2016-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine