sensu-plugins-aws 17.0.0 → 17.1.0

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: b05e0394036396881a2c21bdf8c448eb856c59ce2d6b823552bcca6bbdcc6d7f
4
- data.tar.gz: 1ee23068ea1c8d72f2fcf549baa0213cb2d4beda05664861890302a26caf50e0
3
+ metadata.gz: 4b3566bdc0ab0237dcd040876fa2b09bdbc7bce7e91da122944e72f30c5b07c8
4
+ data.tar.gz: 3e9862e8c961a2f785089eb316b053f45aea4d9f933db02432aaa69eb3f3ca16
5
5
  SHA512:
6
- metadata.gz: 63e63fa98ee696e071f56809357695c80a206618964b0dc85f160d87e42bd8db2c693b97622d82f66153205d8ce4a42b4113589e1496e15a0ead826c0a4ce74e
7
- data.tar.gz: f3313e41ad7cf05d9c2717a60cca0061cacbf9bcd3a2734678fa358595f4928c2841615e3212a3f5866798a7f7d2e5c4d0b42d416e12c04af2679b3663babe5b
6
+ metadata.gz: a912ac844cc7fc1b5a18c4a97a1e641f55222560e8f21575109b95b151bfec06b638ceb1e2051abc1cc1ad7f0accb402266814a2631f603f6bf8b350298d0d20
7
+ data.tar.gz: 6ccf79572a2598648d60746e5ce6ea45b43f4cfc055baf2919342c9752ffc8d042d59189a70a6ff380ab1bf515fa41f1a14ba2a44032cbec62b685b903363233
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
+
8
+ ## [17.1.0] - 2019-04-02
9
+ ### Changed
10
+ - `metrics-cloudfront.rb` now accepts multiple metrics. (@boutetnico)
11
+ - `lib/cloudwatch-common.rb` now accepts percentile stats. (@rajiv)
12
+
13
+
7
14
  ## [17.0.0] - 2019-03-26
8
15
  ### Breaking Changes
9
16
  - `metrics-cloudfront.rb` `--metric` option was renamed to `--metrics`. (@boutetnico)
@@ -553,7 +560,8 @@ WARNING: This release contains major breaking changes that will impact all user
553
560
  ### Added
554
561
  - initial release
555
562
 
556
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.0.0...HEAD
563
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.1.0...HEAD
564
+ [17.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.0.0...17.1.0
557
565
  [17.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/16.2.0...17.0.0
558
566
  [16.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/16.1.0...16.2.0
559
567
  [16.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/16.0.0...16.1.0
@@ -6,7 +6,11 @@ module CloudwatchCommon
6
6
  end
7
7
 
8
8
  def read_value(resp, stats)
9
- resp.datapoints.sort_by(&:timestamp).last.send(stats.downcase)
9
+ if extended_stats? stats
10
+ resp.datapoints.sort_by(&:timestamp).last.extended_statistics[stats]
11
+ else
12
+ resp.datapoints.sort_by(&:timestamp).last.send(stats.downcase)
13
+ end
10
14
  end
11
15
 
12
16
  def resp_has_no_data(resp, stats)
@@ -26,17 +30,23 @@ module CloudwatchCommon
26
30
  end
27
31
  end
28
32
 
33
+ def extended_stats?(stats)
34
+ stats[/p\d+\.\d+|p\d+/] # Check for percentile format
35
+ end
36
+
29
37
  def metrics_request(config)
30
- {
38
+ request = {
31
39
  namespace: config[:namespace],
32
40
  metric_name: config[:metric_name],
33
41
  dimensions: config[:dimensions],
34
42
  start_time: Time.now - config[:period] * 10,
35
43
  end_time: Time.now,
36
44
  period: config[:period],
37
- statistics: [config[:statistics]],
38
45
  unit: config[:unit]
39
46
  }
47
+ stats_key = extended_stats?(config[:statistics]) ? :extended_statistics : :statistics
48
+ request[stats_key] = [config[:statistics]]
49
+ request
40
50
  end
41
51
 
42
52
  def get_metric(metric)
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 17
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.0.0
4
+ version: 17.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-27 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin