interferon 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/interferon/version.rb +1 -1
- data/lib/interferon.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 135a20c25de376d383417a2422e23aa21b0beaef
|
4
|
+
data.tar.gz: e1f3761d1879482fd78adea7ed02bb4646f019d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73d944dfb3d1cb0e0082f406c54faf72bef2636b9e980278770d8e8cb95acf49106634e7a36388ae8b28d3812648860b42d40324b2b017641915fdb58d5eeb83
|
7
|
+
data.tar.gz: 5e7b9b47b9556bb0e102aad9cd5c7b4d8f678d5d7772e3fb534181d9eddd5afd92f0690b395efc7ac3fcb095fe240b7209dea874d8e1b5afb1ad386ebc50fded
|
data/lib/interferon/version.rb
CHANGED
data/lib/interferon.rb
CHANGED
@@ -34,6 +34,7 @@ module Interferon
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def run
|
37
|
+
start_time = Time.new.to_f
|
37
38
|
Signal.trap('TERM') do
|
38
39
|
log.info('SIGTERM received. shutting down gracefully...')
|
39
40
|
@request_shutdown = true
|
@@ -52,10 +53,12 @@ module Interferon
|
|
52
53
|
|
53
54
|
update_alerts(@destinations, hosts, alerts, groups)
|
54
55
|
|
56
|
+
run_time = Time.new.to_f - start_time
|
55
57
|
if @request_shutdown
|
56
58
|
log.info("interferon #{run_desc} shut down by SIGTERM")
|
57
59
|
else
|
58
|
-
|
60
|
+
statsd.gauge('run_time', run_time)
|
61
|
+
log.info("interferon #{run_desc} complete in %.2f seconds" % run_time)
|
59
62
|
end
|
60
63
|
end
|
61
64
|
|
@@ -173,7 +176,7 @@ module Interferon
|
|
173
176
|
run_time,
|
174
177
|
tags: ["destination:#{dest.class.name}"]
|
175
178
|
)
|
176
|
-
log.info("#{dest.class.name}
|
179
|
+
log.info("#{dest.class.name}: run completed in %.2f seconds" % run_time)
|
177
180
|
|
178
181
|
# report destination stats
|
179
182
|
dest.report_stats
|