logstash-core 2.0.1.snapshot1-java → 2.1.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +0,0 @@
1
- # encoding: utf-8
2
- class InflightEventsReporter
3
- def self.logger=(logger)
4
- @logger = logger
5
- end
6
-
7
- def self.start(input_to_filter, filter_to_output, outputs)
8
- Thread.new do
9
- loop do
10
- sleep 5
11
- report(input_to_filter, filter_to_output, outputs)
12
- end
13
- end
14
- end
15
-
16
- def self.report(input_to_filter, filter_to_output, outputs)
17
- report = {
18
- "input_to_filter" => input_to_filter.size,
19
- "filter_to_output" => filter_to_output.size,
20
- "outputs" => []
21
- }
22
- outputs.each do |output|
23
- next unless output.worker_queue && output.worker_queue.size > 0
24
- report["outputs"] << [output.inspect, output.worker_queue.size]
25
- end
26
- @logger.warn ["INFLIGHT_EVENTS_REPORT", Time.now.iso8601, report]
27
- end
28
- end
@@ -1,42 +0,0 @@
1
- # encoding: utf-8
2
- require "spec_helper"
3
- require "pluginmanager/util"
4
- require "gems"
5
-
6
- describe LogStash::PluginManager do
7
-
8
- let(:plugin_name) { "logstash-output-elasticsearch" }
9
-
10
- let(:version_data) do
11
- [ { "authors"=>"Elastic", "built_at"=>"2015-08-11T00:00:00.000Z", "description"=>"Output events to elasticsearch",
12
- "downloads_count"=>1638, "metadata"=>{"logstash_group"=>"output", "logstash_plugin"=>"true"}, "number"=>"2.0.0.pre",
13
- "summary"=>"Logstash Output to Elasticsearch", "platform"=>"java", "ruby_version"=>">= 0", "prerelease"=>true,
14
- "licenses"=>["apache-2.0"], "requirements"=>[], "sha"=>"194b27099c13605a882a3669e2363fdecccaab1de48dd44b0cda648dd5516799"},
15
- { "authors"=>"Elastic", "built_at"=>"2015-08-10T00:00:00.000Z", "description"=>"Output events to elasticsearch",
16
- "downloads_count"=>1638, "metadata"=>{"logstash_group"=>"output", "logstash_plugin"=>"true"}, "number"=>"1.0.7",
17
- "summary"=>"Logstash Output to Elasticsearch", "platform"=>"java", "ruby_version"=>">= 0", "prerelease"=>false,
18
- "licenses"=>["apache-2.0"], "requirements"=>[], "sha"=>"194b27099c13605a882a3669e2363fdecccaab1de48dd44b0cda648dd5516799"},
19
- { "authors"=>"Elastic", "built_at"=>"2015-08-09T00:00:00.000Z", "description"=>"Output events to elasticsearch",
20
- "downloads_count"=>1638, "metadata"=>{"logstash_group"=>"output", "logstash_plugin"=>"true"}, "number"=>"1.0.4",
21
- "summary"=>"Logstash Output to Elasticsearch", "platform"=>"java", "ruby_version"=>">= 0", "prerelease"=>false,
22
- "licenses"=>["apache-2.0"], "requirements"=>[], "sha"=>"194b27099c13605a882a3669e2363fdecccaab1de48dd44b0cda648dd5516799"} ]
23
- end
24
-
25
- before(:each) do
26
- allow(Gems).to receive(:versions).with(plugin_name).and_return(version_data)
27
- end
28
-
29
- context "fetch plugin info" do
30
-
31
- it "should search for the last version infomation non prerelease" do
32
- version_info = LogStash::PluginManager.fetch_latest_version_info(plugin_name)
33
- expect(version_info["number"]).to eq("1.0.7")
34
- end
35
-
36
-
37
- it "should search for the last version infomation with prerelease" do
38
- version_info = LogStash::PluginManager.fetch_latest_version_info(plugin_name, :pre => true)
39
- expect(version_info["number"]).to eq("2.0.0.pre")
40
- end
41
- end
42
- end