sidekiq-cloudwatchmetrics 1.2.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -0
- data/README.md +8 -1
- data/lib/sidekiq/cloudwatchmetrics.rb +11 -3
- data.tar.gz.sig +2 -0
- metadata +49 -9
- metadata.gz.sig +2 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb8deb7fa07fddb75c82ec3b631a803c0d12bb67176e4c210675be9e5b5e2206
|
4
|
+
data.tar.gz: d4ea3bb0ecec06fdbe5e52f95f1bef2505bbc89550346301f5720f1750944335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9568afd5661bb2f0520f109cbe671d85880cf834b919ee20813e7980bcee4426559b654596e352c23e3e3e5c1c5de8e7ffe918402d17aee225f59d122323a80
|
7
|
+
data.tar.gz: f4f68b369bc2cea9f565346f103cff7c1323bf05aa80572181b3a11100b7276ec999bd5b22f15261de000d0c6e33be52d17d80a70b5ec01c0267c9483b3d4a89
|
checksums.yaml.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
���0}���F�rU2�B��7����Cpz3���%W�s�Kd������O��em�"z��r�Lu3�aB��K7�uz�Y�s5�'�v8����Ă���(�����ъ�]2�t����XW����<���T�����LF�̼���u�rzxY����J��f�3}4�f����D�8�`�e��}����N���'��>���)�Q���w��M8w�J����,�^�9�Tkzi��2-ż��H>�#��O˔�H
|
data/README.md
CHANGED
@@ -35,11 +35,18 @@ through environment variables that aws-sdk expects. You can also explicitly
|
|
35
35
|
supply an [aws-sdk CloudWatch Client instance][cwclient]:
|
36
36
|
|
37
37
|
```ruby
|
38
|
-
Sidekiq::CloudWatchMetrics.enable!(client:
|
38
|
+
Sidekiq::CloudWatchMetrics.enable!(client: Aws::CloudWatch::Client.new)
|
39
39
|
```
|
40
40
|
|
41
41
|
[cwclient]: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/CloudWatch/Client.html
|
42
42
|
|
43
|
+
The default namespace for metrics is "Sidekiq". You can configure this with the `namespace` option:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
Sidekiq::CloudWatchMetrics.enable!(client: Aws::CloudWatch::Client.new, namespace: "Sidekiq-Staging")
|
47
|
+
```
|
48
|
+
|
49
|
+
|
43
50
|
## Development
|
44
51
|
|
45
52
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -38,8 +38,9 @@ module Sidekiq::CloudWatchMetrics
|
|
38
38
|
|
39
39
|
INTERVAL = 60 # seconds
|
40
40
|
|
41
|
-
def initialize(client: Aws::CloudWatch::Client.new, additional_dimensions: {})
|
41
|
+
def initialize(client: Aws::CloudWatch::Client.new, namespace: "Sidekiq", additional_dimensions: {})
|
42
42
|
@client = client
|
43
|
+
@namespace = namespace
|
43
44
|
@additional_dimensions = additional_dimensions.map { |k, v| {name: k.to_s, value: v.to_s} }
|
44
45
|
end
|
45
46
|
|
@@ -155,6 +156,14 @@ module Sidekiq::CloudWatchMetrics
|
|
155
156
|
value: process["busy"] / process["concurrency"].to_f * 100.0,
|
156
157
|
unit: "Percent",
|
157
158
|
}
|
159
|
+
|
160
|
+
metrics << {
|
161
|
+
metric_name: "Utilization",
|
162
|
+
dimensions: [{name: "Tag", value: process["tag"]}],
|
163
|
+
timestamp: now,
|
164
|
+
value: process["busy"] / process["concurrency"].to_f * 100.0,
|
165
|
+
unit: "Percent",
|
166
|
+
}
|
158
167
|
end
|
159
168
|
|
160
169
|
queues.each do |(queue_name, queue_size)|
|
@@ -182,11 +191,10 @@ module Sidekiq::CloudWatchMetrics
|
|
182
191
|
metric[:dimensions] = (metric[:dimensions] || []) + @additional_dimensions
|
183
192
|
end
|
184
193
|
end
|
185
|
-
|
186
194
|
# We can only put 20 metrics at a time
|
187
195
|
metrics.each_slice(20) do |some_metrics|
|
188
196
|
@client.put_metric_data(
|
189
|
-
namespace:
|
197
|
+
namespace: @namespace,
|
190
198
|
metric_data: some_metrics,
|
191
199
|
)
|
192
200
|
end
|
data.tar.gz.sig
ADDED
metadata
CHANGED
@@ -1,29 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-cloudwatchmetrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Cochran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDKDCCAhCgAwIBAgIBCDANBgkqhkiG9w0BAQsFADA6MQ0wCwYDVQQDDARzajI2
|
14
|
+
MRQwEgYKCZImiZPyLGQBGRYEc2oyNjETMBEGCgmSJomT8ixkARkWA2NvbTAeFw0y
|
15
|
+
MTA0MjcwMzIxMjZaFw0yMjA0MjcwMzIxMjZaMDoxDTALBgNVBAMMBHNqMjYxFDAS
|
16
|
+
BgoJkiaJk/IsZAEZFgRzajI2MRMwEQYKCZImiZPyLGQBGRYDY29tMIIBIjANBgkq
|
17
|
+
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr60Eo/ttCk8GMTMFiPr3GoYMIMFvLak
|
18
|
+
xSmTk9YGCB6UiEePB4THSSA5w6IPyeaCF/nWkDp3/BAam0eZMWG1IzYQB23TqIM0
|
19
|
+
1xzcNRvFsn0aQoQ00k+sj+G83j3T5OOV5OZIlu8xAChMkQmiPd1NXc6uFv+Iacz7
|
20
|
+
kj+CMsI9YUFdNoU09QY0b+u+Rb6wDYdpyvN60YC30h0h1MeYbvYZJx/iZK4XY5zu
|
21
|
+
4O/FL2ChjL2CPCpLZW55ShYyrzphWJwLOJe+FJ/ZBl6YXwrzQM9HKnt4titSNvyU
|
22
|
+
KzE3L63A3PZvExzLrN9u09kuWLLJfXB2sGOlw3n9t72rJiuBr3/OQQIDAQABozkw
|
23
|
+
NzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU99dfRjEKFyczTeIz
|
24
|
+
m3ZsDWrNC80wDQYJKoZIhvcNAQELBQADggEBAInkmTwBeGEJ7Xu9jjZIuFaE197m
|
25
|
+
YfvrzVoE6Q1DlWXpgyhhxbPIKg2acvM/Z18A7kQrF7paYl64Ti84dC64seOFIBNx
|
26
|
+
Qj/lxzPHMBoAYqeXYJhnYIXnvGCZ4Fkic5Bhs+VdcDP/uwYp3adqy+4bT/XDFZQg
|
27
|
+
tSjrAOTg3wck5aI+Tz90ONQJ83bnCRr1UPQ0T3PbWMjnNsEa9CAxUB845Sg+9yUz
|
28
|
+
Tvf+pbX8JT9rawFDogxPhL7eRAbjg4MH9amp5l8HTVCAsW8vqv7wM4rtMNAaXmik
|
29
|
+
LJghfDEf70fTtbs4Zv57pPhn1b7wBNf8fh+TZOlYAA6dFtQXoCwfE6bWgQU=
|
30
|
+
-----END CERTIFICATE-----
|
31
|
+
date: 2022-02-24 00:00:00.000000000 Z
|
12
32
|
dependencies:
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: sidekiq
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
16
36
|
requirements:
|
17
|
-
- - "
|
37
|
+
- - ">="
|
18
38
|
- !ruby/object:Gem::Version
|
19
39
|
version: '5.0'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '7.0'
|
20
43
|
type: :runtime
|
21
44
|
prerelease: false
|
22
45
|
version_requirements: !ruby/object:Gem::Requirement
|
23
46
|
requirements:
|
24
|
-
- - "
|
47
|
+
- - ">="
|
25
48
|
- !ruby/object:Gem::Version
|
26
49
|
version: '5.0'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '7.0'
|
27
53
|
- !ruby/object:Gem::Dependency
|
28
54
|
name: aws-sdk-cloudwatch
|
29
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +70,14 @@ dependencies:
|
|
44
70
|
requirements:
|
45
71
|
- - "~>"
|
46
72
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
73
|
+
version: '2.2'
|
48
74
|
type: :development
|
49
75
|
prerelease: false
|
50
76
|
version_requirements: !ruby/object:Gem::Requirement
|
51
77
|
requirements:
|
52
78
|
- - "~>"
|
53
79
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
80
|
+
version: '2.2'
|
55
81
|
- !ruby/object:Gem::Dependency
|
56
82
|
name: rake
|
57
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +120,20 @@ dependencies:
|
|
94
120
|
- - "~>"
|
95
121
|
- !ruby/object:Gem::Version
|
96
122
|
version: '0.9'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: rexml
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '3.2'
|
130
|
+
type: :development
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - "~>"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '3.2'
|
97
137
|
description: |
|
98
138
|
Runs a thread inside your Sidekiq processes to report metrics to CloudWatch
|
99
139
|
useful for autoscaling and keeping an eye on your queues.
|
@@ -117,7 +157,7 @@ require_paths:
|
|
117
157
|
- lib
|
118
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
119
159
|
requirements:
|
120
|
-
- - "
|
160
|
+
- - ">="
|
121
161
|
- !ruby/object:Gem::Version
|
122
162
|
version: '2.4'
|
123
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -126,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
166
|
- !ruby/object:Gem::Version
|
127
167
|
version: '0'
|
128
168
|
requirements: []
|
129
|
-
rubygems_version: 3.1.
|
169
|
+
rubygems_version: 3.1.6
|
130
170
|
signing_key:
|
131
171
|
specification_version: 4
|
132
172
|
summary: Publish Sidekiq metrics to AWS CloudWatch
|
metadata.gz.sig
ADDED