sensu-plugins-aws 17.0.0 → 17.1.0
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 +9 -1
- data/lib/sensu-plugins-aws/cloudwatch-common.rb +13 -3
- data/lib/sensu-plugins-aws/version.rb +1 -1
- 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: 4b3566bdc0ab0237dcd040876fa2b09bdbc7bce7e91da122944e72f30c5b07c8
|
|
4
|
+
data.tar.gz: 3e9862e8c961a2f785089eb316b053f45aea4d9f933db02432aaa69eb3f3ca16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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
|
-
|
|
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)
|
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.
|
|
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
|
|
11
|
+
date: 2019-04-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sensu-plugin
|