riemann-babbler 2.8.1 → 2.8.2

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: 5d309eed8bd60ad4eda63dcb183df8239d69d085
4
- data.tar.gz: 78faedc3c512c7cb9efb4b5f2ce2316c24c33549
3
+ metadata.gz: 2db7f224c53340296399c759d9f5b71bf0ce5e5b
4
+ data.tar.gz: ee51fcb80b82629a83ee3d992722145f42b3ff00
5
5
  SHA512:
6
- metadata.gz: c631ca2230fe694cb26c285cc54a32834268a451504ffc1af2df2e2f711d73ae023fd62658f3b5fe22a5c3ddee2ed44272c871dc6076c39b1c4953e238623849
7
- data.tar.gz: e504c619e9eb73a044054214513cfb3c618c4e7dc56cbc0237239224b4de61a57df133af4d44f0b0628da51d5105e63be19c480c64b13fe61b65e2507a5b807c
6
+ metadata.gz: e224bbc2eecdc2df22319c9b7f56cccec5ea6094492cbe62ab1eda7d8011cd322b45093dda3dabfa70b2ea5a1dbf41aa3a1ffb7a5cd050fb7235379b662e1200
7
+ data.tar.gz: d37572598ac88b4b78d90d1666bd2b714384c6859db64ab61849c0d72e5b15c8ae3023ac9f99269a79cd6aaea256d4b9f5e9a3b95194f209a14589111379a5a2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- riemann-babbler (2.8.1)
4
+ riemann-babbler (2.8.2)
5
5
  beefcake
6
6
  configatron
7
7
  docile
@@ -152,11 +152,11 @@ module Riemann
152
152
  # Main method
153
153
  def run!
154
154
  return 0 unless run_plugin
155
- t0 = Time.now
155
+ sleep Random.new.rand(10)
156
156
  loop do
157
-
157
+ t_start = Time.now
158
158
  begin
159
- Timeout::timeout(plugin.interval) { tick }
159
+ Timeout::timeout(plugin.interval.to_f * 2/3 ) { tick }
160
160
  rescue TimeoutError
161
161
  plugin_error!('Timeout plugin execution')
162
162
  rescue => e
@@ -164,8 +164,7 @@ module Riemann
164
164
  else
165
165
  plugin_no_error!
166
166
  end
167
-
168
- sleep(plugin.interval - ((Time.now - t0) % plugin.interval))
167
+ sleep(plugin.interval - (Time.now - t_start).to_i)
169
168
  end
170
169
 
171
170
  end
@@ -43,7 +43,11 @@ module Riemann
43
43
  log :debug, "Check alive of threads [#{@mapping.count}]"
44
44
  @mapping.each do |plugin, thread|
45
45
  next if thread.alive?
46
- log :error, "Plugin: #{plugin} is #{thread.inspect}, run it..."
46
+ begin
47
+ thread.join
48
+ rescue => e
49
+ log :error, "has error #{e.class}: #{e}\n #{e.backtrace.join("\n")}"
50
+ end
47
51
  @mapping[plugin] = run_thread(plugin)
48
52
  end
49
53
  end
@@ -11,7 +11,7 @@ module Riemann
11
11
  include Riemann::Babbler::Options
12
12
  include Riemann::Babbler::Errors
13
13
 
14
- INTERVAL_FLUSH = 0.1
14
+ INTERVAL_FLUSH = 1
15
15
 
16
16
  attr_accessor :host, :port, :events
17
17
 
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  module Babbler
3
- VERSION = '2.8.1'
3
+ VERSION = '2.8.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-babbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasiliev Dmitry