logstash-input-cloudwatch 2.2.3 → 2.2.4

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: a510dd0fdae41fa3f90b430beea28b6a19927861b5137bfd6965af7155b61797
4
- data.tar.gz: e34c11c48c1566686479861d292f18c4ed11221287de3fe0efb53fa3afb28dae
3
+ metadata.gz: a757033201d4a0fdb0be8dee7bb5af1f2c006e313063994f04a6ede079d7dc1f
4
+ data.tar.gz: f05592b5ea230907679d93be0dfdd8c5fc203b04efeb0c8b8c7bd31c5bc6c9bf
5
5
  SHA512:
6
- metadata.gz: b250a0540c6d2eb54c8e5d1bfcc4ecfeedd6b7c8491f7bebdcca7733fad76e263196cf21e8ac35cc41899281917bdd30768da28c2b4fd2340070a2079cd99533
7
- data.tar.gz: 71f11bf11b1c342fba686c6eb2f0aa6108197f4323e9f1b65b0f12c00a4ac36833d550a7ada04c972bf33b0e89bc6b1d2182943618f3096674c26155a1999490
6
+ metadata.gz: 242e72c4deccedaf1c0f301a18c3477c5d9ee766f577d105eac80cc6f40d01342254909a5334788ed7859c93ca23d73f9b791b78dae4b8a3a109c90285a9099f
7
+ data.tar.gz: acefeb53a70030356ca7c97226ac9aa582b82f0d6eae426ef686c74ae601d8ecd636508368e0a6234feb76ae843fffb8a5c13f5c213f709177fba4792269c308
@@ -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
- Stud.interval(@interval) do
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'
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.3
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-12 00:00:00.000000000 Z
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