logstash-input-cloudwatch 2.2.3 → 2.2.4
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/CHANGELOG.md +3 -0
- data/lib/logstash/inputs/cloudwatch.rb +5 -1
- data/logstash-input-cloudwatch.gemspec +1 -1
- data/spec/inputs/cloudwatch_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a757033201d4a0fdb0be8dee7bb5af1f2c006e313063994f04a6ede079d7dc1f
|
4
|
+
data.tar.gz: f05592b5ea230907679d93be0dfdd8c5fc203b04efeb0c8b8c7bd31c5bc6c9bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 242e72c4deccedaf1c0f301a18c3477c5d9ee766f577d105eac80cc6f40d01342254909a5334788ed7859c93ca23d73f9b791b78dae4b8a3a109c90285a9099f
|
7
|
+
data.tar.gz: acefeb53a70030356ca7c97226ac9aa582b82f0d6eae426ef686c74ae601d8ecd636508368e0a6234feb76ae843fffb8a5c13f5c213f709177fba4792269c308
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 2.2.4
|
2
|
+
- Fixed shutdown handling [#43](https://github.com/logstash-plugins/logstash-input-cloudwatch/pull/43)
|
3
|
+
|
1
4
|
## 2.2.3
|
2
5
|
- Fixed issue where metric timestamp was being lost due to over-writing by end_time [#38](https://github.com/logstash-plugins/logstash-input-cloudwatch/pull/38)
|
3
6
|
|
@@ -146,7 +146,9 @@ class LogStash::Inputs::CloudWatch < LogStash::Inputs::Base
|
|
146
146
|
#
|
147
147
|
# @param queue [Array] Logstash queue
|
148
148
|
def run(queue)
|
149
|
-
|
149
|
+
while !stop?
|
150
|
+
start = Time.now
|
151
|
+
|
150
152
|
@logger.info('Polling CloudWatch API')
|
151
153
|
|
152
154
|
raise 'No metrics to query' unless metrics_for(@namespace).count > 0
|
@@ -161,6 +163,8 @@ class LogStash::Inputs::CloudWatch < LogStash::Inputs::Base
|
|
161
163
|
@combined ? from_filters(queue, metric) : from_resources(queue, metric)
|
162
164
|
end
|
163
165
|
end
|
166
|
+
sleep_for = @interval - (Time.now - start)
|
167
|
+
Stud.stoppable_sleep(sleep_for) { stop? } if sleep_for > 0
|
164
168
|
end # loop
|
165
169
|
end # def run
|
166
170
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-cloudwatch'
|
3
|
-
s.version = '2.2.
|
3
|
+
s.version = '2.2.4'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = "Pulls events from the Amazon Web Services CloudWatch API "
|
6
6
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
@@ -51,6 +51,19 @@ describe LogStash::Inputs::CloudWatch do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
describe 'shutdown' do
|
55
|
+
let(:metrics) { double("metrics") }
|
56
|
+
let(:config) { super().merge('namespace' => 'AWS/EC2') }
|
57
|
+
|
58
|
+
before do
|
59
|
+
allow(subject).to receive(:metrics_for).and_return(metrics)
|
60
|
+
allow(metrics).to receive(:count).and_return(1)
|
61
|
+
allow(metrics).to receive(:each).and_return(['DiskWriteBytes'])
|
62
|
+
end
|
63
|
+
|
64
|
+
it_behaves_like "an interruptible input plugin"
|
65
|
+
end
|
66
|
+
|
54
67
|
describe '#register' do
|
55
68
|
|
56
69
|
context "EC2 namespace" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-cloudwatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurgens du Toit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|