logstash-input-ganglia 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/logstash-input-ganglia.gemspec +1 -1
- data/spec/inputs/ganglia_spec.rb +3 -4
- data/spec/spec_helper.rb +0 -44
- 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: f7dc431f64bfc09bfaeff29fb4a670560f8154b4
|
4
|
+
data.tar.gz: 611a8c4325fdb9229b8031b4ca9233b4227ad1b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66203e8d76fae74fc95f9610cbb9feffb9c67d673a77a28f7a96745bc246e5e64d6f523c0d85ae198c51ae56bc81a3875acaab9d5d34a2bf3dcd0858603955d1
|
7
|
+
data.tar.gz: 28d0ad30bcc7a06fe6c9e6eebb87c87dd95a534552a1d96032a6f7a3e6242d209344529c691f095f18bfcf2f412bcbb441921faee6adad1da7726b7f741d7217
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 2.0.3
|
2
|
+
- Fix test to be able to run withint the LS core default plugins
|
3
|
+
integration system.
|
4
|
+
|
1
5
|
## 2.0.0
|
2
6
|
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
3
7
|
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-ganglia'
|
4
|
-
s.version = '2.0.
|
4
|
+
s.version = '2.0.3'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Read ganglia packets from the network via udp"
|
7
7
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|
data/spec/inputs/ganglia_spec.rb
CHANGED
@@ -45,10 +45,9 @@ describe LogStash::Inputs::Ganglia do
|
|
45
45
|
let(:client) { GangliaClient.new("0.0.0.0", port) }
|
46
46
|
|
47
47
|
let(:events) do
|
48
|
-
input(conf
|
49
|
-
nevents.times
|
50
|
-
|
51
|
-
end
|
48
|
+
input(conf) do |pipeline, queue|
|
49
|
+
nevents.times { client.send(data) }
|
50
|
+
nevents.times.collect { queue.pop }
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
data/spec/spec_helper.rb
CHANGED
@@ -2,47 +2,3 @@
|
|
2
2
|
require "logstash/devutils/rspec/spec_helper"
|
3
3
|
require "logstash/inputs/ganglia"
|
4
4
|
require_relative "support/client"
|
5
|
-
|
6
|
-
module GangliaHelpers
|
7
|
-
|
8
|
-
def setup_clients(number_of_clients, port)
|
9
|
-
number_of_clients.times.inject([]) do |clients|
|
10
|
-
clients << GangliaClient.new(localhost, port)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def input(config, size, &block)
|
15
|
-
pipeline = LogStash::Pipeline.new(config)
|
16
|
-
queue = Queue.new
|
17
|
-
|
18
|
-
pipeline.instance_eval do
|
19
|
-
# create closure to capture queue
|
20
|
-
@output_func = lambda { |event| queue << event }
|
21
|
-
|
22
|
-
# output_func is now a method, call closure
|
23
|
-
def output_func(event)
|
24
|
-
@output_func.call(event)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
pipeline_thread = Thread.new { pipeline.run }
|
29
|
-
sleep 0.1 while !pipeline.ready?
|
30
|
-
|
31
|
-
block.call
|
32
|
-
sleep 0.1 while queue.size != size
|
33
|
-
|
34
|
-
result = size.times.inject([]) do |acc|
|
35
|
-
acc << queue.pop
|
36
|
-
end
|
37
|
-
|
38
|
-
pipeline.shutdown
|
39
|
-
pipeline_thread.join
|
40
|
-
|
41
|
-
result
|
42
|
-
end # def input
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
RSpec.configure do |c|
|
47
|
-
c.include GangliaHelpers
|
48
|
-
end
|