mettric 0.1.5 → 0.1.7

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
  SHA1:
3
- metadata.gz: 2af9edc95eb1c3558bb3423c92c17e7d7232c795
4
- data.tar.gz: 4b6c218c4eb1622494cfa1c122b0880ea4e4097e
3
+ metadata.gz: 3877f9991bb5a46bc0c08dfad54d3d594fb9e71c
4
+ data.tar.gz: c1ab8114b49b654a92cf7f50d26ee7725fb87def
5
5
  SHA512:
6
- metadata.gz: 4603b57739d6dcb6bd1d3b72e7caf8fe26efdc4f89fc80fce2553aeb9f6e8db4940066335bbd0f79572d11957c5d6dae36904a29433f80c07c9414d6b17dca83
7
- data.tar.gz: ee41d7cfbcd0f875d7123ee605a41003f53cdb5d7c3be90a5eeba9d20a4984075e5ae590902f096780fe02bdd3c4af31d0a765e63cc3d21f43dd2260b3d14a46
6
+ metadata.gz: b2c5326d53df56739322356765f247dd94ca383275801625229776f376c3d8bc1357d6961d23a093badd68b0a23a42de6887f4a7cf9d6bdbce1b4838b1f0d9dc
7
+ data.tar.gz: cfada3ac03e3e1afbc3c9f3db212b2358ce53c26556c9d12c14ffd921f4191286c4334b7a7d56b5bbdba2e69936d7f7fea862db46570b33a6c4ee7ce07bba37e
@@ -1,21 +1,21 @@
1
1
  require 'active_support/inflector'
2
2
 
3
3
  class Mettric::SidekiqMiddleware
4
- def initialize(_options)
4
+ def initialize(_options = {})
5
5
  end
6
6
 
7
7
  def call(worker, msg, queue)
8
+ opts = worker.class.sidekiq_options['mettric']
9
+
10
+ # Don't do anything if we're told to skip this class
11
+ if opts != true
12
+ return yield
13
+ end
14
+
15
+ # Track the job timing
8
16
  service = "sidekiq.queue.#{queue}.workers.#{worker.class.name.underscore}",
9
17
  Mettric.time(service: service, tags: ['sidekiq']) do
10
18
  yield
11
19
  end
12
20
  end
13
21
  end
14
-
15
- if Kernel.const_defined?(:Sidekiq)
16
- Sidekiq.configure_server do |config|
17
- config.server_middleware do |chain|
18
- chain.add Mettric::SidekiqMiddleware
19
- end
20
- end
21
- end
@@ -1,3 +1,3 @@
1
1
  class Mettric
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mettric
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannis Hermanns