fluent-plugin-cloudwatch 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.1"
7
+ gem.version = "1.2.2"
8
8
  gem.authors = ["Yusuke Nomura", "kenjiskywalker"]
9
9
  gem.email = ["yunomu@gmail.com", "git@kenjiskywalker.org"]
10
10
  gem.description = %q{Input plugin for AWS CloudWatch.}
@@ -64,10 +64,11 @@ class Fluent::CloudwatchInput < Fluent::Input
64
64
  })
65
65
  unless statistics[:datapoints].empty?
66
66
  stat = @statistics.downcase.to_sym
67
- data = statistics[:datapoints][0][stat]
67
+ datapoint = statistics[:datapoints].sort_by{|h| h[:timestamp]}.last
68
+ data = datapoint[stat]
68
69
 
69
70
  # unix time
70
- catch_time = statistics[:datapoints][0][:timestamp].to_i
71
+ catch_time = datapoint[:timestamp].to_i
71
72
 
72
73
  # no output_data.to_json
73
74
  output_data = {m => data}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 1
10
- version: 1.2.1
9
+ - 2
10
+ version: 1.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yusuke Nomura