sidekiq-instrument 0.5.2 → 0.5.4

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: 3818055d583770879264a519e270abd97900bdadc1fb38bfa341e68d08ea17b7
4
- data.tar.gz: 14d508fbe113e65e6093d23ecc6dc3a56ddafb6924200b80af9fe737e42a9914
3
+ metadata.gz: b4112a344ff91a81260af18c47e66fbd1806b9340f9bf0f632d84b405b308c39
4
+ data.tar.gz: 8fddd4f0232f9c9a4b41ec29428e1a39a84c85dacdea09d1b60a0d535af4ff92
5
5
  SHA512:
6
- metadata.gz: 651b65e1354e88685c56a1bdc266efc8b1f8234e0e84ebeb4d989ea490f4ad15ab9e0fb3f4952ce7c864a3c1d3821dc5ea648219815915d668070dfaccd3a195
7
- data.tar.gz: 91360c3448d562455fff7aa6ceb3d1198f72c88087bd0872bf00923cecd3ebf8d33079595873cba4c76c637eb32edaae671e8a439211d12bda4bc393cc6601ad
6
+ metadata.gz: b75d3188a1b15368dc70d3f9fca27844f7a8c89dc52f7d632286c9e05268004c969f48ac37b5d11a9747c64342c74723e38873b0616782c8c19e082ba91531c9
7
+ data.tar.gz: 5508859e81ef17cda16e7582f718f5e36b56ccc836895267927f96d997366340071e035f106252d6b0a9d336c013e451f82222284166b96ee0d26b170a149b9f
data/README.md CHANGED
@@ -101,8 +101,8 @@ For each job, the following metrics and tags will be reported:
101
101
  job fails.
102
102
 
103
103
  For each queue, the following metrics and tags will be reported:
104
- 1. **sidekiq.queue_size (tags: {queue: _queue_})**: gauge of how many jobs are in the queue
105
- 1. **sidekiq.queue_latency (tags: {queue: _queue_})**: gauge of how long the oldest job has been in the queue
104
+ 1. **sidekiq.queue.size (tags: {queue: _queue_})**: gauge of how many jobs are in the queue
105
+ 1. **sidekiq.queue.latency (tags: {queue: _queue_})**: gauge of how long the oldest job has been in the queue
106
106
 
107
107
  ## Worker
108
108
  There is a worker, `Sidekiq::Instrument::Worker`, that submits gauges
@@ -9,7 +9,7 @@ module Sidekiq::Instrument
9
9
  end
10
10
 
11
11
  def worker_dog_options(worker)
12
- { tags: ["queue:#{queue_name(worker)}", "worker:#{class_name(worker)}"] }
12
+ { tags: ["queue:#{queue_name(worker)}", "worker:#{underscore(class_name(worker))}"] }
13
13
  end
14
14
 
15
15
  private
@@ -21,5 +21,13 @@ module Sidekiq::Instrument
21
21
  def class_name(worker)
22
22
  worker.class.name.gsub('::', '_')
23
23
  end
24
+
25
+ def underscore(string)
26
+ string.gsub(/::/, '/').
27
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
28
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
29
+ tr("-", "_").
30
+ downcase
31
+ end
24
32
  end
25
33
  end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Instrument
3
- VERSION = "0.5.2"
3
+ VERSION = "0.5.4"
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ module Sidekiq::Instrument
25
25
  Statter.dogstatsd&.gauge("sidekiq.#{stat}", info.send(method))
26
26
  end
27
27
 
28
- working = Sidekiq::ProcessSet.new.select { |p| p[:busy] == 1 }.count
28
+ working = Sidekiq::Workers.new.count
29
29
  Statter.statsd.gauge('shared.sidekiq.stats.working', working)
30
30
  Statter.dogstatsd&.gauge('sidekiq.working', working)
31
31
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-instrument
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loan Application Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2023-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq