puma-cloudwatch 0.4.1 → 0.4.5
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 +12 -0
- data/README.md +1 -1
- data/lib/puma_cloudwatch/core_ext.rb +0 -1
- data/lib/puma_cloudwatch/metrics/looper.rb +8 -4
- data/lib/puma_cloudwatch/metrics/sender.rb +3 -1
- data/lib/puma_cloudwatch/version.rb +1 -1
- data/puma-cloudwatch.gemspec +1 -1
- metadata +4 -5
- data/lib/puma_cloudwatch/core_ext/array.rb +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70ae556e3b7f637e097d36d0296652566b0dae5c66f1d257013b1653393cf7c4
|
|
4
|
+
data.tar.gz: 80e4da1709178513fc7e8057bb800d15a87e6e2c261b0b5e6916ad10f41eaf04
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d8f25242c010a545080e1236e9f9b6b3b608c660f6a096bbace315632cd2326925e4f322fda0bdf2b31195f5b898c09a2bf7f20c922d3daf6cd657d8e31014a
|
|
7
|
+
data.tar.gz: 998bf6b0ebcd485d5a7212ccc0a2f189ebf588c6b08652f3549628d5dfc97fd6d93eb054ee6f8f670284d1d54453290b6b12bd02f5d470bc2de9db59c3ef6265
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
|
6
|
+
## [0.4.5] - 2021-11-09
|
|
7
|
+
- [#5](https://github.com/boltops-tools/puma-cloudwatch/pull/5) Enabling high-resolution Cloudwatch metrics if frequency is lower tha…
|
|
8
|
+
|
|
9
|
+
## [0.4.4]
|
|
10
|
+
- #4 fix syntax error in older versions of ruby
|
|
11
|
+
|
|
12
|
+
## [0.4.3]
|
|
13
|
+
- #3 Eliminate the need to add Array#sum
|
|
14
|
+
|
|
15
|
+
## [0.4.2]
|
|
16
|
+
- #2 keep looper running on adversities
|
|
17
|
+
|
|
6
18
|
## [0.4.1]
|
|
7
19
|
- #1 empty results breaks cloudwatch put_metric_data
|
|
8
20
|
|
data/README.md
CHANGED
|
@@ -80,4 +80,4 @@ If are you using ECS awsvpc, make sure you have the task running on private subn
|
|
|
80
80
|
|
|
81
81
|
## Contributing
|
|
82
82
|
|
|
83
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
83
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/boltops-tools/puma-cloudwatch
|
|
@@ -32,10 +32,14 @@ class PumaCloudwatch::Metrics
|
|
|
32
32
|
private
|
|
33
33
|
def perform
|
|
34
34
|
loop do
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
begin
|
|
36
|
+
stats = Fetcher.new(@options).call
|
|
37
|
+
results = Parser.new(stats).call
|
|
38
|
+
Sender.new(results).call unless results.empty?
|
|
39
|
+
sleep @frequency
|
|
40
|
+
rescue Exception => e
|
|
41
|
+
puts "Error reached top of looper: #{e.message} (#{e.class})"
|
|
42
|
+
end
|
|
39
43
|
end
|
|
40
44
|
end
|
|
41
45
|
|
|
@@ -16,6 +16,7 @@ class PumaCloudwatch::Metrics
|
|
|
16
16
|
@namespace = ENV['PUMA_CLOUDWATCH_NAMESPACE'] || "WebServer"
|
|
17
17
|
@dimension_name = ENV['PUMA_CLOUDWATCH_DIMENSION_NAME'] || "App"
|
|
18
18
|
@dimension_value = ENV['PUMA_CLOUDWATCH_DIMENSION_VALUE'] || "puma"
|
|
19
|
+
@frequency = Integer(ENV['PUMA_CLOUDWATCH_FREQUENCY'] || 60)
|
|
19
20
|
@enabled = ENV['PUMA_CLOUDWATCH_ENABLED'] || false
|
|
20
21
|
end
|
|
21
22
|
|
|
@@ -55,9 +56,10 @@ class PumaCloudwatch::Metrics
|
|
|
55
56
|
data << {
|
|
56
57
|
metric_name: name.to_s,
|
|
57
58
|
dimensions: dimensions,
|
|
59
|
+
storage_resolution: @frequency < 60 ? 1 : 60,
|
|
58
60
|
statistic_values: {
|
|
59
61
|
sample_count: values.length,
|
|
60
|
-
sum: values.sum,
|
|
62
|
+
sum: values.inject(0) { |sum, el| sum += el },
|
|
61
63
|
minimum: values.min,
|
|
62
64
|
maximum: values.max
|
|
63
65
|
}
|
data/puma-cloudwatch.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.email = ["tongueroo@gmail.com"]
|
|
10
10
|
|
|
11
11
|
spec.summary = "Puma plugin sends puma stats to CloudWatch"
|
|
12
|
-
spec.homepage = "https://github.com/
|
|
12
|
+
spec.homepage = "https://github.com/boltops-tools/puma-cloudwatch"
|
|
13
13
|
spec.license = "MIT"
|
|
14
14
|
|
|
15
15
|
# Specify which files should be added to the gem when it is released.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: puma-cloudwatch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tung Nguyen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-11-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-cloudwatch
|
|
@@ -87,7 +87,6 @@ files:
|
|
|
87
87
|
- lib/puma/plugin/cloudwatch.rb
|
|
88
88
|
- lib/puma_cloudwatch.rb
|
|
89
89
|
- lib/puma_cloudwatch/core_ext.rb
|
|
90
|
-
- lib/puma_cloudwatch/core_ext/array.rb
|
|
91
90
|
- lib/puma_cloudwatch/core_ext/thread.rb
|
|
92
91
|
- lib/puma_cloudwatch/metrics.rb
|
|
93
92
|
- lib/puma_cloudwatch/metrics/fetcher.rb
|
|
@@ -96,7 +95,7 @@ files:
|
|
|
96
95
|
- lib/puma_cloudwatch/metrics/sender.rb
|
|
97
96
|
- lib/puma_cloudwatch/version.rb
|
|
98
97
|
- puma-cloudwatch.gemspec
|
|
99
|
-
homepage: https://github.com/
|
|
98
|
+
homepage: https://github.com/boltops-tools/puma-cloudwatch
|
|
100
99
|
licenses:
|
|
101
100
|
- MIT
|
|
102
101
|
metadata: {}
|
|
@@ -115,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
115
114
|
- !ruby/object:Gem::Version
|
|
116
115
|
version: '0'
|
|
117
116
|
requirements: []
|
|
118
|
-
rubygems_version: 3.1.
|
|
117
|
+
rubygems_version: 3.1.6
|
|
119
118
|
signing_key:
|
|
120
119
|
specification_version: 4
|
|
121
120
|
summary: Puma plugin sends puma stats to CloudWatch
|