sidekiq-cloudwatchmetrics 1.0.1 → 1.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: 0d12e8127fc1e085dfafd8812c3fca0ca8f60d84a18d0c1075df44f3d73dfa7e
4
- data.tar.gz: d122fa6c24b657283c383e00a64be1d6d61ec1f22f6eabb1eb42d14b590992b9
3
+ metadata.gz: 8e3991b16a0ac40b697bd24d4efee3192a8d9bb5ca4c252e2f5cd6135843800d
4
+ data.tar.gz: 53107e6b0601740c0133b1f95396863cb3853d46628d2b4f575102aa496d4110
5
5
  SHA512:
6
- metadata.gz: 86028f3e083b24983f2bf59a850e996c76bd6a0f09c200bcecb386ab914dd5fc48c70ba1fb2ac44edee0db2c22b190eeac79f46f6b609195a067ee7665841218
7
- data.tar.gz: 9a0119a1004c93d68837980ed58103fe293026e89e37ef1d3d39312bdccf038152c73812f0189c1fbb82a713514804ab7e711374086bc2082c7ac6fa96d5bc0f
6
+ metadata.gz: 24311c4a2dca677378aa1a0b44ed33e7957b2e445c9ea39a20de21efb30acf8fc388912a9805c59651d44b822a25205a23f87d85f692d64489d020f29b6f8275
7
+ data.tar.gz: 188acd1c12c6b69315fb17b778ba9e56dadf7e1d05c8af0b8eb84dcddf48ce30cb9bae795ee266a60f0a0fdef1982081b0e0c3eb5cf850e310194ef296457b17
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -75,8 +75,6 @@ module Sidekiq::CloudWatchMetrics
75
75
  now = Time.now
76
76
  stats = Sidekiq::Stats.new
77
77
  processes = Sidekiq::ProcessSet.new.to_enum(:each).to_a
78
- utilization = calculate_utilization(processes)
79
- capacity = calculate_capacity(processes)
80
78
  queues = stats.queues
81
79
 
82
80
  metrics = [
@@ -128,27 +126,37 @@ module Sidekiq::CloudWatchMetrics
128
126
  value: stats.processes_size,
129
127
  unit: "Count",
130
128
  },
129
+ {
130
+ metric_name: "DefaultQueueLatency",
131
+ timestamp: now,
132
+ value: stats.default_queue_latency,
133
+ unit: "Seconds",
134
+ },
131
135
  {
132
136
  metric_name: "Capacity",
133
137
  timestamp: now,
134
- value: capacity,
138
+ value: calculate_capacity(processes),
135
139
  unit: "Count",
136
140
  },
137
141
  {
138
142
  metric_name: "Utilization",
139
143
  timestamp: now,
140
- value: utilization * 100.0,
144
+ value: calculate_utilization(processes) * 100.0,
141
145
  unit: "Percent",
142
146
  },
143
- {
144
- metric_name: "DefaultQueueLatency",
145
- timestamp: now,
146
- value: stats.default_queue_latency,
147
- unit: "Seconds",
148
- },
149
147
  ]
150
148
 
151
- queues.map do |(queue_name, queue_size)|
149
+ processes.each do |process|
150
+ metrics << {
151
+ metric_name: "Utilization",
152
+ dimensions: [{name: "Hostname", value: process["hostname"]}],
153
+ timestamp: now,
154
+ value: process["busy"] / process["concurrency"].to_f * 100.0,
155
+ unit: "Percent",
156
+ }
157
+ end
158
+
159
+ queues.each do |(queue_name, queue_size)|
152
160
  metrics << {
153
161
  metric_name: "QueueSize",
154
162
  dimensions: [{name: "QueueName", value: queue_name}],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-cloudwatchmetrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Cochran
@@ -28,7 +28,7 @@ cert_chain:
28
28
  ccrr0sGoLnfK6DappOwH1I5uPvQohOATNmmU0MSSWOeiggLlEWmUYE7CvzoMc8R6
29
29
  DlumKi5y9wE+XnxtyLbe6GlT3AkVGnhwPdwq2QBFLEWkTVogdCYomBCKfjY=
30
30
  -----END CERTIFICATE-----
31
- date: 2018-08-16 00:00:00.000000000 Z
31
+ date: 2019-01-21 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: sidekiq
@@ -146,8 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubyforge_project:
150
- rubygems_version: 2.7.7
149
+ rubygems_version: 3.0.2
151
150
  signing_key:
152
151
  specification_version: 4
153
152
  summary: Publish Sidekiq metrics to AWS CloudWatch
metadata.gz.sig CHANGED
Binary file