logstash-core 5.0.2-java → 5.1.1.1-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.
- checksums.yaml +4 -4
- data/gemspec_jars.rb +9 -0
- data/lib/logstash-core/logstash-core.jar +0 -0
- data/lib/logstash-core/logstash-core.rb +22 -0
- data/lib/logstash-core/version.rb +1 -1
- data/lib/logstash-core_jars.rb +20 -0
- data/lib/logstash/agent.rb +65 -14
- data/lib/logstash/api/commands/default_metadata.rb +2 -1
- data/lib/logstash/api/commands/stats.rb +3 -2
- data/lib/logstash/config/file.rb +0 -1
- data/lib/logstash/config/loader.rb +1 -0
- data/lib/logstash/config/mixin.rb +2 -6
- data/lib/logstash/environment.rb +25 -2
- data/lib/logstash/event_dispatcher.rb +40 -0
- data/lib/logstash/filter_delegator.rb +1 -1
- data/lib/logstash/filters/base.rb +10 -2
- data/lib/logstash/instrument/metric_store.rb +0 -1
- data/lib/logstash/instrument/metric_type/base.rb +0 -1
- data/lib/logstash/instrument/namespaced_null_metric.rb +54 -0
- data/lib/logstash/instrument/null_metric.rb +55 -46
- data/lib/logstash/instrument/periodic_poller/jvm.rb +26 -3
- data/lib/logstash/instrument/periodic_poller/load_average.rb +47 -0
- data/lib/logstash/instrument/snapshot.rb +0 -1
- data/lib/logstash/java_integration.rb +0 -1
- data/lib/logstash/logging/logger.rb +37 -4
- data/lib/logstash/outputs/base.rb +1 -1
- data/lib/logstash/patches.rb +1 -0
- data/lib/logstash/patches/exception_to_json.rb +5 -0
- data/lib/logstash/pipeline.rb +50 -17
- data/lib/logstash/plugin.rb +14 -48
- data/lib/logstash/plugins/hooks_registry.rb +57 -0
- data/lib/logstash/plugins/registry.rb +208 -45
- data/lib/logstash/runner.rb +10 -5
- data/lib/logstash/settings.rb +101 -9
- data/lib/logstash/universal_plugin.rb +13 -0
- data/lib/logstash/util/byte_value.rb +60 -0
- data/lib/logstash/util/loggable.rb +14 -2
- data/lib/logstash/util/safe_uri.rb +1 -0
- data/lib/logstash/util/time_value.rb +70 -0
- data/lib/logstash/util/wrapped_acked_queue.rb +347 -0
- data/lib/logstash/util/wrapped_synchronous_queue.rb +17 -33
- data/lib/logstash/version.rb +1 -1
- data/locales/en.yml +1 -1
- data/logstash-core.gemspec +13 -18
- data/spec/api/lib/api/node_stats_spec.rb +3 -1
- data/spec/api/lib/api/support/resource_dsl_methods.rb +14 -6
- data/spec/api/spec_helper.rb +1 -0
- data/spec/conditionals_spec.rb +3 -2
- data/spec/logstash/agent_spec.rb +142 -62
- data/spec/logstash/environment_spec.rb +38 -0
- data/spec/logstash/event_dispatcher_spec.rb +76 -0
- data/spec/logstash/filter_delegator_spec.rb +2 -1
- data/spec/logstash/instrument/namespaced_null_metric_spec.rb +33 -0
- data/spec/logstash/instrument/null_metric_spec.rb +9 -5
- data/spec/logstash/instrument/periodic_poller/jvm_spec.rb +40 -0
- data/spec/logstash/instrument/periodic_poller/load_average_spec.rb +91 -0
- data/spec/logstash/output_delegator_spec.rb +2 -1
- data/spec/logstash/patches_spec.rb +15 -4
- data/spec/logstash/pipeline_pq_file_spec.rb +131 -0
- data/spec/logstash/pipeline_spec.rb +21 -17
- data/spec/logstash/plugin_spec.rb +4 -16
- data/spec/logstash/plugins/hooks_registry_spec.rb +60 -0
- data/spec/logstash/plugins/registry_spec.rb +22 -14
- data/spec/logstash/settings/bytes_spec.rb +53 -0
- data/spec/logstash/settings/time_value_spec.rb +31 -0
- data/spec/logstash/settings/writable_directory_spec.rb +125 -0
- data/spec/logstash/settings_spec.rb +39 -0
- data/spec/logstash/util/byte_value_spec.rb +33 -0
- data/spec/logstash/util/time_value_spec.rb +59 -0
- data/spec/logstash/util/wrapped_synchronous_queue_spec.rb +2 -2
- data/spec/logstash/webserver_spec.rb +4 -7
- data/spec/support/helpers.rb +8 -0
- data/spec/support/mocks_classes.rb +61 -31
- metadata +73 -20
- data/lib/jars.rb +0 -7
- data/lib/logstash/config/registry.rb +0 -13
- data/lib/logstash/inputs/metrics.rb +0 -47
- data/spec/logstash/inputs/metrics_spec.rb +0 -51
- data/vendor/jars/com/fasterxml/jackson/core/jackson-core/2.7.4/jackson-core-2.7.4.jar +0 -0
- data/vendor/jars/com/fasterxml/jackson/core/jackson-databind/2.7.4/jackson-databind-2.7.4.jar +0 -0
- data/vendor/jars/org/apache/logging/log4j/log4j-1.2-api/2.6.2/log4j-1.2-api-2.6.2.jar +0 -0
- data/vendor/jars/org/apache/logging/log4j/log4j-api/2.6.2/log4j-api-2.6.2.jar +0 -0
- data/vendor/jars/org/apache/logging/log4j/log4j-core/2.6.2/log4j-core-2.6.2.jar +0 -0
- data/vendor/jars/org/logstash/logstash-core/5.0.2/logstash-core-5.0.2.jar +0 -0
data/lib/jars.rb
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
require 'jar_dependencies'
|
|
2
|
-
require_jar('org.apache.logging.log4j', 'log4j-1.2-api', '2.6.2')
|
|
3
|
-
require_jar('org.apache.logging.log4j', 'log4j-api', '2.6.2')
|
|
4
|
-
require_jar('org.apache.logging.log4j', 'log4j-core', '2.6.2')
|
|
5
|
-
require_jar('com.fasterxml.jackson.core', 'jackson-core', '2.7.4')
|
|
6
|
-
require_jar('com.fasterxml.jackson.core', 'jackson-databind', '2.7.4')
|
|
7
|
-
require_jar('org.logstash', 'logstash-core', '5.0.2')
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require "logstash/namespace"
|
|
3
|
-
|
|
4
|
-
# Global config registry.
|
|
5
|
-
module LogStash::Config::Registry
|
|
6
|
-
@registry = Hash.new
|
|
7
|
-
class << self
|
|
8
|
-
attr_accessor :registry
|
|
9
|
-
|
|
10
|
-
# TODO(sissel): Add some helper methods here.
|
|
11
|
-
end
|
|
12
|
-
end # module LogStash::Config::Registry
|
|
13
|
-
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require "logstash/event"
|
|
3
|
-
require "logstash/inputs/base"
|
|
4
|
-
require "logstash/instrument/collector"
|
|
5
|
-
|
|
6
|
-
module LogStash module Inputs
|
|
7
|
-
# The Metrics inputs is responable of registring itself to the collector.
|
|
8
|
-
# The collector class will periodically emits new snapshot of the system,
|
|
9
|
-
# The metrics need to take that information and transform it into
|
|
10
|
-
# a `Logstash::Event`, which can be consumed by the shipper and send to
|
|
11
|
-
# Elasticsearch
|
|
12
|
-
class Metrics < LogStash::Inputs::Base
|
|
13
|
-
config_name "metrics"
|
|
14
|
-
milestone 3
|
|
15
|
-
|
|
16
|
-
def register
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def run(queue)
|
|
20
|
-
@logger.debug("Metric: input started")
|
|
21
|
-
@queue = queue
|
|
22
|
-
|
|
23
|
-
# we register to the collector after receiving the pipeline queue
|
|
24
|
-
metric.collector.add_observer(self)
|
|
25
|
-
|
|
26
|
-
# Keep this plugin thread alive,
|
|
27
|
-
# until we shutdown the metric pipeline
|
|
28
|
-
sleep(1) while !stop?
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def stop
|
|
32
|
-
@logger.debug("Metrics input: stopped")
|
|
33
|
-
metric.collector.delete_observer(self)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def update(snapshot)
|
|
37
|
-
@logger.debug("Metrics input: received a new snapshot", :created_at => snapshot.created_at, :snapshot => snapshot, :event => snapshot.metric_store.to_event) if @logger.debug?
|
|
38
|
-
|
|
39
|
-
# The back pressure is handled in the collector's
|
|
40
|
-
# scheduled task (running into his own thread) if something append to one of the listener it will
|
|
41
|
-
# will timeout. In a sane pipeline, with a low traffic of events it shouldn't be a problems.
|
|
42
|
-
snapshot.metric_store.each do |metric|
|
|
43
|
-
@queue << LogStash::Event.new({ "@timestamp" => snapshot.created_at }.merge(metric.to_hash))
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end;end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require "logstash/inputs/metrics"
|
|
3
|
-
require "spec_helper"
|
|
4
|
-
|
|
5
|
-
describe LogStash::Inputs::Metrics do
|
|
6
|
-
let(:collector) { LogStash::Instrument::Collector.new }
|
|
7
|
-
let(:metric) { LogStash::Instrument::Metric.new(collector) }
|
|
8
|
-
let(:queue) { [] }
|
|
9
|
-
|
|
10
|
-
before :each do
|
|
11
|
-
subject.metric = metric
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
describe "#run" do
|
|
15
|
-
it "should register itself to the collector observer" do
|
|
16
|
-
expect(collector).to receive(:add_observer).with(subject)
|
|
17
|
-
t = Thread.new { subject.run(queue) }
|
|
18
|
-
sleep(0.1) # give a bit of time to the thread to start
|
|
19
|
-
subject.stop
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
describe "#update" do
|
|
24
|
-
it "should fill up the queue with received events" do
|
|
25
|
-
Thread.new { subject.run(queue) }
|
|
26
|
-
sleep(0.1)
|
|
27
|
-
subject.stop
|
|
28
|
-
|
|
29
|
-
metric.increment([:root, :test], :plugin)
|
|
30
|
-
|
|
31
|
-
subject.update(collector.snapshot_metric)
|
|
32
|
-
expect(queue.count).to eq(1)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
describe "#stop" do
|
|
37
|
-
it "should remove itself from the the collector observer" do
|
|
38
|
-
expect(collector).to receive(:delete_observer).with(subject)
|
|
39
|
-
t = Thread.new { subject.run(queue) }
|
|
40
|
-
sleep(0.1) # give a bit of time to the thread to start
|
|
41
|
-
subject.stop
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it "should unblock the input" do
|
|
45
|
-
t = Thread.new { subject.run(queue) }
|
|
46
|
-
sleep(0.1) # give a bit of time to the thread to start
|
|
47
|
-
subject.do_stop
|
|
48
|
-
wait_for { t.status }.to be_falsey
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
Binary file
|
data/vendor/jars/com/fasterxml/jackson/core/jackson-databind/2.7.4/jackson-databind-2.7.4.jar
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|