sidekiq-instrument 0.5.1 → 0.5.3

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: dba857b68ec105ba55cf962fac3549c2b0c3949859bcebbb2363087ce2965241
4
- data.tar.gz: 99d18adae251771f64a2b1e0f9088c2bf3c1863f9a8a0ec8ebfc40caa3052a0d
3
+ metadata.gz: 8c5ff8d26009611bbdb4c3282c9e6988d2d3bf755c8029095ee6ce9939810db3
4
+ data.tar.gz: fa29960d6ac51cb3d22f230b8c6275bb893a89366ae8710091aa239e4de2829f
5
5
  SHA512:
6
- metadata.gz: e34e0ebf291cf1a869013b042613936c367f84116a2a582ea463dbd9b8bf00b7a11e4fed8dbc87d8ac5946e8d590dbcce769e87394ca75a0906b234440ac746c
7
- data.tar.gz: a9af77fa66acd59ba2552481ede5c24ce308befd307dcd86f7b79552a1d8e8a7665b8c9a6a2e97bdb49edc8f890dc862fcadd3b8d4c41ac38021da3ff852f621
6
+ metadata.gz: 926b9162dc1910c198c441faff6b87c036c8a9d87f91d35159af0ea0c09091971d27e40adba8a87732667f88fd4c132284b14400306ce798282460dd2b6c0445
7
+ data.tar.gz: 662b3f4b9fe31c355831a24cd43f8cd7c98fd5c2f08cc286e38bfbf5747cd40ef8b9775fa26d36069b0f76a175002a1ff17b6f73d9e0922e5e58fa185e58e354
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.1"
3
+ VERSION = "0.5.3"
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
- require 'active_support/core_ext/class/attribute'
1
+ require "active_support/core_ext/class/attribute"
2
+ require "statsd/instrument"
2
3
 
3
4
  require "sidekiq/instrument/statter"
4
5
  require "sidekiq/instrument/version"
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.1
4
+ version: 0.5.3
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-10 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq