sidekiq-statsd 0.1.3 → 0.1.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
  SHA1:
3
- metadata.gz: e503321ba26e952392c4fab627b35d93f2fa479f
4
- data.tar.gz: 8e34258548cf2c0cbe099874821b6b67e76dd019
3
+ metadata.gz: 3e33d3802f9cdc7d435e1e4338f7828f96534f4e
4
+ data.tar.gz: b9db8a5236e5a708fd89af15fdd2c8308afe0214
5
5
  SHA512:
6
- metadata.gz: 01c88a2d9f2a5d9f543d371fad1e0aade1a56b13d601c086c8379cae36c95be8b928609e103ef9d37e1ff5d059fb1bf01df70028d3406b52f5c5a39c9af86bd4
7
- data.tar.gz: affdca31989581d3e757645c2a4189c203c2a2503f9946aa473faf62226053194a095308e3807533c76c5255be5f8913b970acc00b56eeb33fd9211bf0f99c2f
6
+ metadata.gz: 362cd5bdb3f38aae086478fd7068f1cd525959f31dad78ab8eaed707f593055894575c284b1e24e7f2f6fa094d1b7928d35c9af3c86aee31646af79c2cd3de47
7
+ data.tar.gz: da265304addf998d858dded40984207f6819a376d40a423217eb0e5e625e7dae324698e2b89c87ccba4895a76021256e5b136410491fd072a5da5cc12202ef88
data/Gemfile CHANGED
@@ -4,21 +4,21 @@ gemspec
4
4
  gem 'sidekiq', ENV['SIDEKIQ_VERSION'] if ENV['SIDEKIQ_VERSION']
5
5
 
6
6
  group :development do
7
- gem "rake"
8
- gem "pry"
9
- gem "yard"
10
- gem "redcarpet", platforms: [:ruby]
7
+ gem 'rake'
8
+ gem 'pry'
9
+ gem 'yard'
10
+ gem 'redcarpet', platforms: [:ruby]
11
11
 
12
- gem "rspec"
13
- gem "rspec-redis_helper"
14
- gem "timecop"
15
- gem "simplecov"
12
+ gem 'rspec', '~> 2.14.1'
13
+ gem 'rspec-redis_helper'
14
+ gem 'timecop'
15
+ gem 'simplecov'
16
16
 
17
- gem "guard"
18
- gem "guard-bundler"
19
- gem "guard-rspec"
20
- gem "guard-yard"
21
- gem "rb-fsevent"
22
- gem "rb-inotify"
23
- gem "growl"
17
+ gem 'guard'
18
+ gem 'guard-bundler'
19
+ gem 'guard-rspec'
20
+ gem 'guard-yard'
21
+ gem 'rb-fsevent'
22
+ gem 'rb-inotify'
23
+ gem 'growl'
24
24
  end
@@ -34,12 +34,13 @@ module Sidekiq::Statsd
34
34
  def call worker, msg, queue
35
35
  @statsd.batch do |b|
36
36
  begin
37
- b.time prefix(worker.class.name, 'processing_time') do
37
+ worker_name = worker.class.name.gsub("::", ".")
38
+ b.time prefix(worker_name, 'processing_time') do
38
39
  yield
39
40
  end
40
- b.increment prefix(worker.class.name, 'success')
41
+ b.increment prefix(worker_name, 'success')
41
42
  rescue => e
42
- b.increment prefix(worker.class.name, 'failure')
43
+ b.increment prefix(worker_name, 'failure')
43
44
  raise e
44
45
  ensure
45
46
  # Queue sizes
@@ -1,6 +1,6 @@
1
1
  module Sidekiq
2
2
  module Statsd
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
6
6
 
@@ -8,6 +8,8 @@ describe Sidekiq::Statsd::ServerMiddleware do
8
8
  let(:queue) { nil }
9
9
  let(:client) { double(::Statsd).as_null_object }
10
10
 
11
+ let(:worker_name) { worker.class.name.gsub("::", ".") }
12
+
11
13
  let(:clean_job) { ->{} }
12
14
  let(:broken_job) { ->{ raise 'error' } }
13
15
 
@@ -37,7 +39,7 @@ describe Sidekiq::Statsd::ServerMiddleware do
37
39
  it "uses the custom metric name prefix options" do
38
40
  expect(client)
39
41
  .to receive(:time)
40
- .with("development.application.sidekiq.#{worker.class.name}.processing_time", &clean_job)
42
+ .with("development.application.sidekiq.#{worker_name}.processing_time", &clean_job)
41
43
  .once
42
44
 
43
45
  described_class
@@ -54,7 +56,7 @@ describe Sidekiq::Statsd::ServerMiddleware do
54
56
  it "increments success counter" do
55
57
  expect(client)
56
58
  .to receive(:increment)
57
- .with("production.worker.#{worker.class.name}.success")
59
+ .with("production.worker.#{worker_name}.success")
58
60
  .once
59
61
 
60
62
  middleware.call(worker, msg, queue, &job)
@@ -63,7 +65,7 @@ describe Sidekiq::Statsd::ServerMiddleware do
63
65
  it "times the process execution" do
64
66
  expect(client)
65
67
  .to receive(:time)
66
- .with("production.worker.#{worker.class.name}.processing_time", &job)
68
+ .with("production.worker.#{worker_name}.processing_time", &job)
67
69
  .once
68
70
 
69
71
  middleware.call(worker, msg, queue, &job)
@@ -80,13 +82,13 @@ describe Sidekiq::Statsd::ServerMiddleware do
80
82
  before do
81
83
  allow(client)
82
84
  .to receive(:time)
83
- .with("production.worker.#{worker.class.name}.processing_time", &job)
85
+ .with("production.worker.#{worker_name}.processing_time", &job)
84
86
  end
85
87
 
86
88
  it "increments failure counter" do
87
89
  expect(client)
88
90
  .to receive(:increment)
89
- .with("production.worker.#{worker.class.name}.failure")
91
+ .with("production.worker.#{worker_name}.failure")
90
92
  .once
91
93
 
92
94
  expect{ middleware.call(worker, msg, queue, &job) }.to raise_error
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Cantero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-23 00:00:00.000000000 Z
11
+ date: 2014-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport