sqreen 1.1.41481804991-java → 1.1.51482852304-java

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: ebdfb93df8e897256f982e3e9ffb926f5e4fda42
4
- data.tar.gz: 448da6660416d94e7e883f8e012d947eb571c57b
3
+ metadata.gz: 01a62c9c201059de682aab08cfff94a4e7be2067
4
+ data.tar.gz: 5a616438a88b302cf12674b70e0e57d1e7d9440f
5
5
  SHA512:
6
- metadata.gz: a381f24e6847393abffffebdd049b6d379d98c177508262041a64abf8a6ca946d1394542aa47b92f9e91862b46ced724488154357b59c696f6c7c3d49bd3454c
7
- data.tar.gz: 27f8df8ecbf5498ed0175ac73a343a44cd0760a30dabdee5086665097acb3270d5058be3a98c6d314cc7eefb374a63aa0f332db2bcd0dae42751a97493490847
6
+ metadata.gz: 6941e671c429c60abde2e62b1725fd325c06447520f1a09830d9838a52744f062f9f361183d7b10c55bc80970b5823e7411ac282a05bb3b5dcfb968ffa45a89e
7
+ data.tar.gz: 4f762b2fcd10a6294c01ed1d82d2d76cea8f90522f841256e7cf4be6923f59302c6dcd407326497d0224db94ec4ea809c73c95911a51a7bacf44f1cabc789212
@@ -208,6 +208,7 @@ module Sqreen
208
208
 
209
209
  def do_heartbeat
210
210
  @last_heartbeat_request = Time.now
211
+ @next_metrics.concat(metrics_engine.publish(false)) if metrics_engine
211
212
  res = session.heartbeat(next_command_results, next_metrics)
212
213
  next_command_results.clear
213
214
  next_metrics.clear
@@ -246,6 +247,10 @@ module Sqreen
246
247
  end
247
248
  end
248
249
 
250
+ def heartbeat_needed?
251
+ (@last_heartbeat_request + heartbeat_delay) < Time.now
252
+ end
253
+
249
254
  def run_watcher_once
250
255
  event = Timeout.timeout(heartbeat_delay) do
251
256
  Sqreen.queue.pop
@@ -254,12 +259,11 @@ module Sqreen
254
259
  periodic_cleanup
255
260
  else
256
261
  handle_event(event)
257
- if (@last_heartbeat_request + HEARTBEAT_MAX_DELAY) < Time.now
258
- Sqreen.log.debug 'Forced an heartbeat'
259
- do_heartbeat
262
+ if heartbeat_needed?
260
263
  # Also aggregate/post metrics when cleanup has
261
264
  # not been done for a long time
262
- periodic_cleanup
265
+ Sqreen.log.debug 'Forced an heartbeat'
266
+ periodic_cleanup # will trigger do_heartbeat since it's time
263
267
  end
264
268
  end
265
269
 
@@ -269,11 +273,7 @@ module Sqreen
269
273
  # issue a simple heartbeat if it's time (which may return commands)
270
274
  @deliverer.tick
271
275
  aggregate_observations
272
- t = Time.now
273
- if (@last_heartbeat_request + heartbeat_delay) < t
274
- @next_metrics.concat(metrics_engine.publish(false)) if metrics_engine
275
- do_heartbeat
276
- end
276
+ do_heartbeat if heartbeat_needed?
277
277
  end
278
278
 
279
279
  def handle_event(event)
@@ -2,5 +2,5 @@
2
2
  # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
3
  # Warning This file is auto generated! DO NOT edit.
4
4
  module Sqreen
5
- VERSION = "1.1.41481804991".freeze
5
+ VERSION = "1.1.51482852304".freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.41481804991
4
+ version: 1.1.51482852304
5
5
  platform: java
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-15 00:00:00.000000000 Z
11
+ date: 2016-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs