logstash-core 5.0.0.pre.beta1-java → 5.0.0.pre.rc1-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of logstash-core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26f351d2c124e90d1ea8598d1d14a29e001c2f99
4
- data.tar.gz: 0d76b8f8281bfc9860e3dd773fc1340d075b9cce
3
+ metadata.gz: baef1eb320ed6e41540de4f69bc3cedbbd57cf5f
4
+ data.tar.gz: 0386098cd8179ccdda67435e30dac956c65385e2
5
5
  SHA512:
6
- metadata.gz: c256fc86d0b5d9cf975d67436229d11f83cfd3536690a38405257df1909e48eeb2314f3ad5e54813bcdef8fafd326e767fb0b5bf1e3c50a3fd9164042bf7e631
7
- data.tar.gz: a0cf57c53ec0a6182463243f276a903de61adcdfd1ae6b0f861061bb1caec0cb91ab5e0b08748419ec406fc1da75c869197b18e984f0be81217abc7cce3f3465
6
+ metadata.gz: f330b13ca8673330ce1cccc4a1dbbf36e02f4b61ff8f300fe55b26b101738e1ee8f7b9ae3a580acc2fa1e17db2fda2bb99172859ccd52e42558b5285ecb6bced
7
+ data.tar.gz: a884dc890d1fc02c4af8893971498cb6eb9ed5481f9766791a4e8361356953c617cf8322565ee9a3203ddc99892ca4131cc24b0acb12f2e826bd1e2afc68c995
@@ -4,4 +4,4 @@ require_jar('org.apache.logging.log4j', 'log4j-api', '2.6.2')
4
4
  require_jar('org.apache.logging.log4j', 'log4j-core', '2.6.2')
5
5
  require_jar('com.fasterxml.jackson.core', 'jackson-core', '2.7.4')
6
6
  require_jar('com.fasterxml.jackson.core', 'jackson-databind', '2.7.4')
7
- require_jar('org.logstash', 'logstash-core', '5.0.0-beta1')
7
+ require_jar('org.logstash', 'logstash-core', '5.0.0-rc1')
@@ -5,4 +5,4 @@
5
5
  # Note to authors: this should not include dashes because 'gem' barfs if
6
6
  # you include a dash in the version string.
7
7
 
8
- LOGSTASH_CORE_VERSION = "5.0.0-beta1"
8
+ LOGSTASH_CORE_VERSION = "5.0.0-rc1"
@@ -188,6 +188,10 @@ module LogStash module Instrument
188
188
  end
189
189
  end
190
190
 
191
+ def size
192
+ @fast_lookup.size
193
+ end
194
+
191
195
  private
192
196
  def get_all
193
197
  @fast_lookup.values
@@ -165,7 +165,7 @@ class LogStash::Runner < Clamp::StrictCommand
165
165
  rescue => e
166
166
  # abort unless we're just looking for the help
167
167
  if (["--help", "-h"] & args).empty?
168
- $stderr.puts "INFO: Logstash has a new settings file which defines start up time settings. This file is typically located in $LS_HOME/config or /etc/logstash. If you installed Logstash through a package and are starting it manually please specify the location to this settings file by passing in \"--path.settings=/path/..\" in the command line options"
168
+ $stderr.puts "INFO: Logstash requires a setting file which is typically located in $LS_HOME/config or /etc/logstash. If you installed Logstash through a package and are starting it manually please specify the location to this settings file by passing in \"--path.settings=/path/..\""
169
169
  $stderr.puts "ERROR: Failed to load settings file from \"path.settings\". Aborting... path.setting=#{LogStash::SETTINGS.get("path.settings")}, exception=#{e.class}, message=>#{e.message}"
170
170
  return 1
171
171
  end
@@ -190,6 +190,12 @@ class LogStash::Runner < Clamp::StrictCommand
190
190
  end
191
191
  # override log level that may have been introduced from a custom log4j config file
192
192
  LogStash::Logging::Logger::configure_logging(setting("log.level"))
193
+
194
+ # Adding this here because a ton of LS users install LS via packages and try to manually
195
+ # start Logstash using bin/logstash. See #5986. I think not logging to console is good for
196
+ # services, but until LS users re-learn that logs end up in path.logs, we should keep this
197
+ # message. Otherwise we'll be answering the same question again and again.
198
+ puts "Sending Logstash logs to #{setting("path.logs")} which is now configured via log4j2.properties."
193
199
 
194
200
  if setting("config.debug") && logger.debug?
195
201
  logger.warn("--config.debug was specified, but log.level was not set to \'debug\'! No config info will be logged.")
@@ -198,14 +204,14 @@ class LogStash::Runner < Clamp::StrictCommand
198
204
  LogStash::Util::set_thread_name(self.class.name)
199
205
 
200
206
  if RUBY_VERSION < "1.9.2"
201
- $stderr.puts "Ruby 1.9.2 or later is required. (You are running: " + RUBY_VERSION + ")"
207
+ logger.fatal "Ruby 1.9.2 or later is required. (You are running: " + RUBY_VERSION + ")"
202
208
  return 1
203
209
  end
204
210
 
205
211
  # Exit on bad java versions
206
212
  java_version = LogStash::Util::JavaVersion.version
207
213
  if LogStash::Util::JavaVersion.bad_java_version?(java_version)
208
- $stderr.puts "Java version 1.8.0 or later is required. (You are running: #{java_version})"
214
+ logger.fatal "Java version 1.8.0 or later is required. (You are running: #{java_version})"
209
215
  return 1
210
216
  end
211
217
 
@@ -237,6 +243,7 @@ class LogStash::Runner < Clamp::StrictCommand
237
243
  begin
238
244
  LogStash::Pipeline.new(config_str)
239
245
  puts "Configuration OK"
246
+ logger.info "Using config.test_and_exit mode. Config Validation Result: OK. Exiting Logstash"
240
247
  return 0
241
248
  rescue => e
242
249
  logger.fatal I18n.t("logstash.runner.invalid-configuration", :error => e.message)
@@ -256,7 +263,8 @@ class LogStash::Runner < Clamp::StrictCommand
256
263
  @agent_task = Stud::Task.new { @agent.execute }
257
264
 
258
265
  # no point in enabling config reloading before the agent starts
259
- sighup_id = trap_sighup()
266
+ # also windows doesn't have SIGHUP. we can skip it
267
+ sighup_id = LogStash::Environment.windows? ? nil : trap_sighup()
260
268
 
261
269
  agent_return = @agent_task.wait
262
270
 
@@ -90,9 +90,14 @@ module LogStash; module Util
90
90
  def take_batch
91
91
  @mutex.synchronize do
92
92
  batch = ReadBatch.new(@queue, @batch_size, @wait_for)
93
- add_starting_metrics(batch)
94
93
  set_current_thread_inflight_batch(batch)
95
- start_clock
94
+
95
+ # We dont actually have any events to work on so lets
96
+ # not bother with recording metrics for them
97
+ if batch.size > 0
98
+ add_starting_metrics(batch)
99
+ start_clock
100
+ end
96
101
  batch
97
102
  end
98
103
  end
@@ -116,8 +121,10 @@ module LogStash; module Util
116
121
  end
117
122
 
118
123
  def stop_clock
119
- @inflight_clocks[Thread.current].each(&:stop)
120
- @inflight_clocks.delete(Thread.current)
124
+ unless @inflight_clocks[Thread.current].nil?
125
+ @inflight_clocks[Thread.current].each(&:stop)
126
+ @inflight_clocks.delete(Thread.current)
127
+ end
121
128
  end
122
129
 
123
130
  def add_starting_metrics(batch)
@@ -11,4 +11,4 @@
11
11
  # eventually this file should be in the root logstash lib fir and dependencies in logstash-core should be
12
12
  # fixed.
13
13
 
14
- LOGSTASH_VERSION = "5.0.0-beta1"
14
+ LOGSTASH_VERSION = "5.0.0-rc1"
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.require_paths = ["lib", "vendor/jars"]
18
18
  gem.version = LOGSTASH_CORE_VERSION
19
19
 
20
- gem.add_runtime_dependency "logstash-core-event-java", "5.0.0-beta1"
20
+ gem.add_runtime_dependency "logstash-core-event-java", "5.0.0-rc1"
21
21
 
22
22
  gem.add_runtime_dependency "pry", "~> 0.10.1" #(Ruby license)
23
23
  gem.add_runtime_dependency "stud", "~> 0.0.19" #(Apache 2.0 license)
@@ -203,6 +203,12 @@ describe LogStash::Instrument::MetricStore do
203
203
  end
204
204
  end
205
205
 
206
+ describe "#size" do
207
+ it "returns the number of unique metrics" do
208
+ expect(subject.size).to eq(metric_events.size)
209
+ end
210
+ end
211
+
206
212
  describe "#each" do
207
213
  it "retrieves all the metric" do
208
214
  expect(subject.each.size).to eq(metric_events.size)
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require "spec_helper"
3
3
  require "logstash/util/wrapped_synchronous_queue"
4
+ require "logstash/instrument/collector"
4
5
 
5
6
  describe LogStash::Util::WrappedSynchronousQueue do
6
7
  context "#offer" do
@@ -45,11 +46,47 @@ describe LogStash::Util::WrappedSynchronousQueue do
45
46
  end
46
47
 
47
48
  describe "WriteClient | ReadClient" do
48
- context "when writing to the queue" do
49
- let(:queue) { DummyQueue.new }
50
- let(:write_client) { LogStash::Util::WrappedSynchronousQueue::WriteClient.new(queue)}
51
- let(:read_client) { LogStash::Util::WrappedSynchronousQueue::ReadClient.new(queue)}
49
+ let(:queue) { DummyQueue.new }
50
+ let(:write_client) { LogStash::Util::WrappedSynchronousQueue::WriteClient.new(queue)}
51
+ let(:read_client) { LogStash::Util::WrappedSynchronousQueue::ReadClient.new(queue)}
52
+
53
+ context "when reading from the queue" do
54
+ let(:collector) { LogStash::Instrument::Collector.new }
55
+
56
+ before do
57
+ read_client.set_events_metric(LogStash::Instrument::Metric.new(collector).namespace(:events))
58
+ read_client.set_pipeline_metric(LogStash::Instrument::Metric.new(collector).namespace(:pipeline))
59
+ end
60
+
61
+ context "when the queue is empty" do
62
+ it "doesnt record the `duration_in_millis`" do
63
+ batch = read_client.take_batch
64
+ read_client.close_batch(batch)
65
+ store = collector.snapshot_metric.metric_store
66
+ expect(store.size).to eq(0)
67
+ end
68
+ end
52
69
 
70
+ context "when we have item in the queue" do
71
+ it "records the `duration_in_millis`" do
72
+ batch = write_client.get_new_batch
73
+ 5.times {|i| batch.push("value-#{i}")}
74
+ write_client.push_batch(batch)
75
+ read_batch = read_client.take_batch
76
+ sleep(0.1) # simulate some work?
77
+ read_client.close_batch(batch)
78
+ store = collector.snapshot_metric.metric_store
79
+
80
+ expect(store.size).to eq(4)
81
+ expect(store.get_shallow(:events, :in).value).to eq(5)
82
+ expect(store.get_shallow(:events, :duration_in_millis).value).to be > 0
83
+ expect(store.get_shallow(:pipeline, :in).value).to eq(5)
84
+ expect(store.get_shallow(:pipeline, :duration_in_millis).value).to be > 0
85
+ end
86
+ end
87
+ end
88
+
89
+ context "when writing to the queue" do
53
90
  before :each do
54
91
  read_client.set_events_metric(LogStash::Instrument::NullMetric.new)
55
92
  read_client.set_pipeline_metric(LogStash::Instrument::NullMetric.new)
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.pre.beta1
4
+ version: 5.0.0.pre.rc1
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2016-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 5.0.0.pre.beta1
18
+ version: 5.0.0.pre.rc1
19
19
  name: logstash-core-event-java
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0.pre.beta1
26
+ version: 5.0.0.pre.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -464,7 +464,7 @@ files:
464
464
  - vendor/jars/org/apache/logging/log4j/log4j-1.2-api/2.6.2/log4j-1.2-api-2.6.2.jar
465
465
  - vendor/jars/org/apache/logging/log4j/log4j-api/2.6.2/log4j-api-2.6.2.jar
466
466
  - vendor/jars/org/apache/logging/log4j/log4j-core/2.6.2/log4j-core-2.6.2.jar
467
- - vendor/jars/org/logstash/logstash-core/5.0.0-beta1/logstash-core-5.0.0-beta1.jar
467
+ - vendor/jars/org/logstash/logstash-core/5.0.0-rc1/logstash-core-5.0.0-rc1.jar
468
468
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
469
469
  licenses:
470
470
  - Apache License (2.0)