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 +4 -4
- data/lib/sqreen/runner.rb +9 -9
- data/lib/sqreen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01a62c9c201059de682aab08cfff94a4e7be2067
|
4
|
+
data.tar.gz: 5a616438a88b302cf12674b70e0e57d1e7d9440f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6941e671c429c60abde2e62b1725fd325c06447520f1a09830d9838a52744f062f9f361183d7b10c55bc80970b5823e7411ac282a05bb3b5dcfb968ffa45a89e
|
7
|
+
data.tar.gz: 4f762b2fcd10a6294c01ed1d82d2d76cea8f90522f841256e7cf4be6923f59302c6dcd407326497d0224db94ec4ea809c73c95911a51a7bacf44f1cabc789212
|
data/lib/sqreen/runner.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
-
|
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)
|
data/lib/sqreen/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|