logstash-output-newrelic 1.0.7 → 1.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e227255c0f05ab2bbd664c45fd3ed25e7edfc9e15481255052688c5dfd1ddd2e
4
- data.tar.gz: f3add56ccb74bac8b9f6106f9862254250c6adab4d79723c9fb89940dd5f2c5d
3
+ metadata.gz: 15a58f1472c4f00bc1decbd672cf520a247d192eb6b31b348bc6daa77f2ea27c
4
+ data.tar.gz: f71834a29f1507c3948d9044826b7c2cc23e249121b57dacd65103bc8d22f742
5
5
  SHA512:
6
- metadata.gz: 5b1e8ffc8dacea562486112bdca20cff806da7b21336d3e03612cda334fbb0882c26b6f3ce6e230f1f53c5b8e56627bd675009b0c4bc2741d2628999a434375c
7
- data.tar.gz: 6bd40c68709a7c1fc63bcb9002e538b49a340526c00e617cdfb3e7b988393b705b12179732cf4a93fcab05dad067789e8c1219b3466483d248d3d23878b1f39f
6
+ metadata.gz: 9db4eb7268c9c401932ff4bfd2055ca8475c69c962d3a99f41dec89e51833f6b9c527eb887b65d520d20e322401798a231cb5ae53c7d8c78c3bc6581cef77d29
7
+ data.tar.gz: b95f9564bd9f6c51d38a3995c86733b78cdaa9cb474ffda178a05006d6f10f47e4fbdb31e1934e0e4e9f31821487dd26be65a49f617c503add87fa394d689982
@@ -36,6 +36,12 @@ class LogStash::Outputs::NewRelic < LogStash::Outputs::Base
36
36
  # Used by tests so that the test run can complete (background threads prevent JVM exit)
37
37
  def shutdown
38
38
  @executor&.shutdown
39
+ # We want this long enough to not have threading issues
40
+ terminationWaitInSeconds = 10
41
+ terminatedInTime = @executor&.awaitTermination(terminationWaitInSeconds, java.util.concurrent.TimeUnit::SECONDS)
42
+ if !terminatedInTime
43
+ raise "Did not shut down within #{terminationWaitInSeconds} seconds"
44
+ end
39
45
  end
40
46
 
41
47
  def time_to_logstash_timestamp(time)
@@ -67,6 +73,10 @@ class LogStash::Outputs::NewRelic < LogStash::Outputs::Base
67
73
  end
68
74
 
69
75
  def multi_receive(events)
76
+ if events.size == 0
77
+ return
78
+ end
79
+
70
80
  payload = []
71
81
  events.each do |event|
72
82
  payload.push(encode(event.to_hash))
@@ -1,7 +1,7 @@
1
1
  module LogStash
2
2
  module Outputs
3
3
  module NewRelicVersion
4
- VERSION = "1.0.7"
4
+ VERSION = "1.0.8"
5
5
  end
6
6
  end
7
7
  end
@@ -193,6 +193,19 @@ describe LogStash::Outputs::NewRelic do
193
193
  .to have_been_made
194
194
  end
195
195
 
196
+ it "zero events should not cause an HTTP call" do
197
+ stub_request(:any, base_uri).to_return(status: 200)
198
+
199
+ @newrelic_output.multi_receive([])
200
+
201
+ # Shut down the plugin so that it has the chance to send a request
202
+ # (since we're verifying that nothing is sent)
203
+ @newrelic_output&.shutdown
204
+
205
+ expect(a_request(:post, base_uri))
206
+ .not_to have_been_made
207
+ end
208
+
196
209
  it "multiple events" do
197
210
  stub_request(:any, base_uri).to_return(status: 200)
198
211
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-newrelic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - New Relic Logging Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-06 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement