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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e06dab2517dc06edf86da60cb55249bf63d031d
4
- data.tar.gz: e370782305dda94dca3215c57dfc8bceb633ed77
3
+ metadata.gz: 135a20c25de376d383417a2422e23aa21b0beaef
4
+ data.tar.gz: e1f3761d1879482fd78adea7ed02bb4646f019d2
5
5
  SHA512:
6
- metadata.gz: bef7463ead0dc65ab0c2e8018feb13a85a419ecc02e2403e9ee15150cc29089d8d471609ae9c7ae421c0f6c112fd39f5746b9cff7288c43535ffb32cf4c88d2d
7
- data.tar.gz: f8b07e1239591b50e07facca30186412c74eda5b19bd4d128b634bf1a8c477b449aaa7894ff6fc3181ab781f1011901778e37a663f6d337a56abc21dc9bd8462
6
+ metadata.gz: 73d944dfb3d1cb0e0082f406c54faf72bef2636b9e980278770d8e8cb95acf49106634e7a36388ae8b28d3812648860b42d40324b2b017641915fdb58d5eeb83
7
+ data.tar.gz: 5e7b9b47b9556bb0e102aad9cd5c7b4d8f678d5d7772e3fb534181d9eddd5afd92f0690b395efc7ac3fcb095fe240b7209dea874d8e1b5afb1ad386ebc50fded
@@ -1,3 +1,3 @@
1
1
  module Interferon
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
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
- log.info("interferon #{run_desc} complete")
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} : run completed in %.2f seconds" % run_time)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interferon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Serebryany