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 +4 -4
- data/lib/logstash/inputs/mongoprofile.rb +23 -14
- data/logstash-input-mongoprofile.gemspec +1 -1
- 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: 3102b42e17eee1f36dea358db6f356ef0ad0e711
|
4
|
+
data.tar.gz: b64d8da8cf5a674b3f5b2a34dbbfcfab8c106404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
34
|
-
@
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
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
|