fluent-plugin-cloudwatch 1.2.11 → 1.2.12

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
  SHA1:
3
- metadata.gz: 16f4d81fc801c7d7a7c78ebebc2be609f48a14fd
4
- data.tar.gz: 88fd100bbc9048bb5bf934cc9ffe1c0b0508a5be
3
+ metadata.gz: 623454cb13e5f86266ed713a9a3887d0b641a123
4
+ data.tar.gz: ba8b5303fdd6766782f9ab0714fe6fc7ef76d22f
5
5
  SHA512:
6
- metadata.gz: a07f2d45d7624244083d267fd0989d17830b6dc98bf1220b01eccd87086cdf3c7606dfc7bd4e36e75f271e537bfc98c0104ea112eff8fb113f40fab56e2178a8
7
- data.tar.gz: 037f89c27acac8543483a9a15e5eaaa8925cf2a8a004e8b0ad7004a2fd27dc40a8ac074fe114cec0a433751fe5802566d939a0dc865879ef7416d10e8246c751
6
+ metadata.gz: 7dfef965c1ceab2f8cbe2ff2d9be4cc83b9a724d94115a4f65cb9428bf2ccfab7f09a4fb4a699fb112e9b3ebe24c86a60a9da38df9e7b25aef8a14b20d17f1ef
7
+ data.tar.gz: 1adefd4cdc57162c3a1f919cfaa88e83b568705792489a058aed0bda393572e8e62ee8f04645e011fa37e214851bf56d8892460d3cacc0b1ea7926d8f98aa078
data/README.md CHANGED
@@ -212,6 +212,16 @@ Note: Billing requires the us-east-1 endpoint
212
212
 
213
213
  When config `delayed_start` is set true, plugin startup will be delayed in random seconds(0 ~ interval).
214
214
 
215
+ ## config: offset
216
+
217
+ unit: seconds.
218
+
219
+ flunet-plugin-cloudwatch gets metrics between now and `period` × 10 sec ago, and pick a latest value from that.
220
+
221
+ But the latest metric is insufficient for `statistics Sum`.
222
+
223
+ If `offset` is specified, fluent-plugin-cloudwatch gets metrics between `offset` sec ago and older.
224
+
215
225
  ## Contributing
216
226
 
217
227
  1. Fork it
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "fluent-plugin-cloudwatch"
7
- gem.version = "1.2.11"
7
+ gem.version = "1.2.12"
8
8
  gem.authors = ["Yusuke Nomura", "kenjiskywalker", "FUJIWARA Shunichiro"]
9
9
  gem.email = ["yunomu@gmail.com", "git@kenjiskywalker.org", "fujiwara.shunichiro@gmail.com"]
10
10
  gem.description = %q{Input plugin for AWS CloudWatch.}
@@ -26,6 +26,7 @@ class Fluent::CloudwatchInput < Fluent::Input
26
26
  config_param :open_timeout, :integer, :default => 10
27
27
  config_param :read_timeout, :integer, :default => 30
28
28
  config_param :delayed_start, :bool, :default => false
29
+ config_param :offset, :integer, :default => 0
29
30
 
30
31
  attr_accessor :dimensions
31
32
 
@@ -130,13 +131,14 @@ class Fluent::CloudwatchInput < Fluent::Input
130
131
 
131
132
  def output
132
133
  @metric_name.split(",").each {|m|
134
+ now = Time.now - @offset
133
135
  statistics = @cw.get_metric_statistics({
134
136
  :namespace => @namespace,
135
137
  :metric_name => m,
136
138
  :statistics => [@statistics],
137
139
  :dimensions => @dimensions,
138
- :start_time => (Time.now - @period*10).iso8601,
139
- :end_time => Time.now.iso8601,
140
+ :start_time => (now - @period*10).iso8601,
141
+ :end_time => now.iso8601,
140
142
  :period => @period,
141
143
  })
142
144
  unless statistics[:datapoints].empty?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.11
4
+ version: 1.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Nomura
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-07-31 00:00:00.000000000 Z
13
+ date: 2015-12-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fluentd