logstash-input-mongoprofile 0.1.3 → 0.1.4

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: f26f651e99da27cbe03bf873ef7bb6c736db4fb2
4
- data.tar.gz: bb5705c865fd804733ed18cb815a63af8b39751e
3
+ metadata.gz: 3102b42e17eee1f36dea358db6f356ef0ad0e711
4
+ data.tar.gz: b64d8da8cf5a674b3f5b2a34dbbfcfab8c106404
5
5
  SHA512:
6
- metadata.gz: 64467f27ef79e98ad9f299168c09822727c562c69ea3d3ca5098630266fb7454d4225348e0a74131e078c0063bd1b959d221a4f0a9e73a2e99c979ac194bf6a7
7
- data.tar.gz: fed81e42dc1464f287804c922513c5fbd1749dab5dd91bd515c920e7820360a686f7e6af562d06ca42ffebd8950eae5b729c7cd184f1cbddc130f1c87665ea5a
6
+ metadata.gz: af0482c58dc1dcac984060548e926558670964af2e5bd1d14a2d2601b1941423030ede9638618864d9947572d7fde7dd5f4e36cbbbfee9b4431d02aafe22b3c5
7
+ data.tar.gz: d05f7abbaab618d1d00b338aa1a3565bbaebfed0e31979d68801b516ef7551a3cb094d8618bb9a6e2a0e3201de99ac24a7849d1a1b0ab246eb89a8cb219f1019
@@ -24,26 +24,35 @@ class LogStash::Inputs::Mongoprofile < LogStash::Inputs::Base
24
24
  def register
25
25
  @host = Socket.gethostname
26
26
  @controller = Controller.new(@host, @url, 'system.profile', 1000, @path, @client_host)
27
- end # def register
27
+ end
28
+
29
+ # def register
28
30
 
29
31
  def run(queue)
30
32
  # we can abort the loop if stop? becomes true
31
33
  while !stop?
32
-
33
- @controller.get_next_events.each do |event|
34
- @logger.info("Send event #{event}")
35
-
36
- decorate(event)
37
- queue << event
34
+ begin
35
+
36
+ @controller.get_next_events.each do |event|
37
+ @logger.info("Send event #{event}")
38
+
39
+ decorate(event)
40
+ queue << event
41
+ end
42
+
43
+ # because the sleep interval can be big, when shutdown happens
44
+ # we want to be able to abort the sleep
45
+ # Stud.stoppable_sleep will frequently evaluate the given block
46
+ # and abort the sleep(@interval) if the return value is true
47
+ Stud.stoppable_sleep(@interval) {stop?}
48
+ rescue => e
49
+ @logger.warn('MongoProfile input threw an exception, restarting', :exception => e)
50
+ @logger.warn(e.backtrace.inspect)
38
51
  end
39
-
40
- # because the sleep interval can be big, when shutdown happens
41
- # we want to be able to abort the sleep
42
- # Stud.stoppable_sleep will frequently evaluate the given block
43
- # and abort the sleep(@interval) if the return value is true
44
- Stud.stoppable_sleep(@interval) { stop? }
45
52
  end # loop
46
- end # def run
53
+ end
54
+
55
+ # def run
47
56
 
48
57
  def stop
49
58
  # nothing to do in this case so it is not necessary to define stop
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-mongoprofile'
3
- s.version = '0.1.3'
3
+ s.version = '0.1.4'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'MongoDB system.profile input plugin'
6
6
  s.description = 'MongoDB system.profile input plugin'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-mongoprofile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Antonov