logstash-output-newrelic 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15a58f1472c4f00bc1decbd672cf520a247d192eb6b31b348bc6daa77f2ea27c
|
4
|
+
data.tar.gz: f71834a29f1507c3948d9044826b7c2cc23e249121b57dacd65103bc8d22f742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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))
|
@@ -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.
|
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-
|
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
|