resque-cloudwatch-metrics 0.2.0 → 0.3.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/docker/Gemfile.lock +1 -1
- data/lib/resque/cloudwatch/metrics/metric.rb +10 -4
- data/lib/resque/cloudwatch/metrics/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 733c1beb5e744c021fd6367622aa79aa5f9c0ad7
|
4
|
+
data.tar.gz: 93cca39a1c74279ed2b35ed394f59895dd51289d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f824a25e5cef1afe76edfbbbc4a04754caa044fb206731e5f4fffd1ae13454b0202716d7a3f487ffbe39dcacb7cc6d783cb5d486141b1b0710ff71a6f62dd889
|
7
|
+
data.tar.gz: 98b97cf81fa69c0b6ef21a73fedcedbd78937871d3e057a58ce610026856a3a444ef90c422c8e3480f9841ca232241d9b08883ebad5f21a3a69db5688be9151d
|
data/docker/Gemfile.lock
CHANGED
@@ -56,15 +56,17 @@ module Resque
|
|
56
56
|
def workers; @info[:workers]; end
|
57
57
|
def working; @info[:working]; end
|
58
58
|
|
59
|
+
def not_working
|
60
|
+
[0, workers - working].max
|
61
|
+
end
|
62
|
+
|
59
63
|
def processing
|
60
64
|
incremental_size_of_processed + working
|
61
65
|
end
|
62
66
|
|
63
67
|
def to_cloudwatch_metric_data
|
64
|
-
|
65
|
-
|
66
|
-
%i(pending processed failed queues workers working processing).map do |key|
|
67
|
-
build_cloudwatch_metric_datum(key.to_s.capitalize, public_send(key))
|
68
|
+
%i(pending processed failed queues workers working not_working processing).map do |key|
|
69
|
+
build_cloudwatch_metric_datum(camelize(key.to_s), public_send(key))
|
68
70
|
end +
|
69
71
|
@queue_sizes.map do |name, size|
|
70
72
|
build_cloudwatch_metric_datum('Pending', size, queue: name)
|
@@ -94,6 +96,10 @@ module Resque
|
|
94
96
|
[0, processed - @previous_processed].max
|
95
97
|
end
|
96
98
|
end
|
99
|
+
|
100
|
+
def camelize(string)
|
101
|
+
string.gsub(/(?:^|_)(.)/) { $1.upcase }
|
102
|
+
end
|
97
103
|
end
|
98
104
|
|
99
105
|
class Dimensions < Hash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-cloudwatch-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Takeuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|