sidekiq-instrumental 0.3.3.beta1 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d14f250c271b145a6c61534eff188d74ed8f8382d57ab5528222a3a2bb924756
|
4
|
+
data.tar.gz: 8dddb6c4aa02f3d71f6e43ed09e78d9f3da62f6ab3c453eed266ca15fa7c4ef7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4e2f11e879c4c6af1fc88a1df84cc8ce2bb373ba7c1c7c8ce2674e1997a793c361ecd77fe9d539002e387aebae8e66cfe48d186a4ba889da2f7e978776c8b4a
|
7
|
+
data.tar.gz: dcaa77759c298e69e5400b72cf0cddcdb479430e21786a15a020c6b647393fd773c9359aa950a38b127714644aa398708d0756220c159bb3dc5693cc620d3cc7
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
9
9
|
### Changed
|
10
10
|
### Fixed
|
11
11
|
|
12
|
+
## [0.3.4]
|
13
|
+
### Fixed
|
14
|
+
- cover multiple possible returns types of display_class
|
15
|
+
|
12
16
|
## [0.3.3]
|
13
17
|
### Fixed
|
14
18
|
- Fix unwrap_class_name, it was wrongly expecting an instance not a class.
|
@@ -69,6 +69,16 @@ RSpec.describe Sidekiq::Instrumental::Middleware::Client do
|
|
69
69
|
subject
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
73
|
+
context 'when the class is not passed as a string' do
|
74
|
+
let(:msg) { { 'class' => stub_const('MyClassName', Class.new) } }
|
75
|
+
|
76
|
+
it 'increments the queued metric for the queue' do
|
77
|
+
expect(middleware).to receive(:increment).with("sidekiq.#{queue}.queued")
|
78
|
+
|
79
|
+
subject
|
80
|
+
end
|
81
|
+
end
|
72
82
|
end
|
73
83
|
|
74
84
|
it 'calls display_class to get the class name' do
|
@@ -89,32 +99,66 @@ RSpec.describe Sidekiq::Instrumental::Middleware::Client do
|
|
89
99
|
let(:msg) do
|
90
100
|
{
|
91
101
|
'class' => 'ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper',
|
92
|
-
'wrapped' =>
|
93
|
-
'args' =>
|
102
|
+
'wrapped' => passed_class,
|
103
|
+
'args' => args
|
94
104
|
}
|
95
105
|
end
|
106
|
+
let(:args) { [] }
|
96
107
|
|
97
|
-
context "when sidekiq's wrapped class is
|
98
|
-
let(:wrapped_class) { 'ActionMailer::DeliveryJob' }
|
108
|
+
context "when sidekiq's wrapped class is a mail delivery job" do
|
109
|
+
let(:wrapped_class) { stub_const('ActionMailer::DeliveryJob', Class.new) }
|
110
|
+
let(:args) { [{ 'arguments' => %w[UserMailer confirm_account deliver_now User] }] }
|
99
111
|
|
100
|
-
|
101
|
-
|
102
|
-
.to receive(:increment)
|
103
|
-
.with("sidekiq.#{queue}.user_mailer_confirm_account.queued")
|
112
|
+
context 'when passed as a String' do
|
113
|
+
let(:passed_class) { wrapped_class.to_s }
|
104
114
|
|
105
|
-
|
115
|
+
it 'unwraps the class name and increments the metric' do
|
116
|
+
expect(middleware)
|
117
|
+
.to receive(:increment)
|
118
|
+
.with("sidekiq.#{queue}.user_mailer_confirm_account.queued")
|
119
|
+
|
120
|
+
subject
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
context 'when passed as a Class' do
|
125
|
+
let(:passed_class) { wrapped_class }
|
126
|
+
|
127
|
+
it 'unwraps the class name and increments the metric' do
|
128
|
+
expect(middleware)
|
129
|
+
.to receive(:increment)
|
130
|
+
.with("sidekiq.#{queue}.user_mailer_confirm_account.queued")
|
131
|
+
|
132
|
+
subject
|
133
|
+
end
|
106
134
|
end
|
107
135
|
end
|
108
136
|
|
109
|
-
context "when sidekiq's wrapped class is
|
110
|
-
let(:wrapped_class) { stub_const('
|
137
|
+
context "when sidekiq's wrapped class is not a mail delivery job" do
|
138
|
+
let(:wrapped_class) { stub_const('Jobs::Job', Class.new) }
|
111
139
|
|
112
|
-
|
113
|
-
|
114
|
-
.to receive(:increment)
|
115
|
-
.with("sidekiq.#{queue}.user_mailer_confirm_account.queued")
|
140
|
+
context 'when passed as a String' do
|
141
|
+
let(:passed_class) { wrapped_class.to_s }
|
116
142
|
|
117
|
-
|
143
|
+
it 'unwraps the class name and increments the metric' do
|
144
|
+
expect(middleware)
|
145
|
+
.to receive(:increment)
|
146
|
+
.with("sidekiq.#{queue}.jobs_job.queued")
|
147
|
+
|
148
|
+
subject
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
context 'when passed as a Class' do
|
153
|
+
let(:passed_class) { wrapped_class }
|
154
|
+
|
155
|
+
it 'unwraps the class name and increments the metric' do
|
156
|
+
expect(middleware)
|
157
|
+
.to receive(:increment)
|
158
|
+
.with("sidekiq.#{queue}.jobs_job.queued")
|
159
|
+
|
160
|
+
subject
|
161
|
+
end
|
118
162
|
end
|
119
163
|
end
|
120
164
|
end
|
@@ -122,6 +122,16 @@ RSpec.describe Sidekiq::Instrumental::Middleware::Server do
|
|
122
122
|
subject
|
123
123
|
end
|
124
124
|
end
|
125
|
+
|
126
|
+
context 'when the class is not passed as a string' do
|
127
|
+
let(:msg) { { 'class' => stub_const('MyClassName', Class.new) } }
|
128
|
+
|
129
|
+
it 'increments the queued metric for the queue' do
|
130
|
+
expect(middleware).to receive(:increment).with("sidekiq.#{queue}.processed")
|
131
|
+
|
132
|
+
subject
|
133
|
+
end
|
134
|
+
end
|
125
135
|
end
|
126
136
|
|
127
137
|
it 'gauge elapsed time metric for the class' do
|
@@ -138,32 +148,66 @@ RSpec.describe Sidekiq::Instrumental::Middleware::Server do
|
|
138
148
|
let(:msg) do
|
139
149
|
{
|
140
150
|
'class' => 'ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper',
|
141
|
-
'wrapped' =>
|
142
|
-
'args' =>
|
151
|
+
'wrapped' => passed_class,
|
152
|
+
'args' => args
|
143
153
|
}
|
144
154
|
end
|
155
|
+
let(:args) { [] }
|
145
156
|
|
146
|
-
context "when sidekiq's wrapped class is
|
147
|
-
let(:wrapped_class) { 'ActionMailer::DeliveryJob' }
|
157
|
+
context "when sidekiq's wrapped class is a mail delivery job" do
|
158
|
+
let(:wrapped_class) { stub_const('ActionMailer::DeliveryJob', Class.new) }
|
159
|
+
let(:args) { [{ 'arguments' => %w[UserMailer confirm_account deliver_now User] }] }
|
148
160
|
|
149
|
-
|
150
|
-
|
151
|
-
.to receive(:increment)
|
152
|
-
.with("sidekiq.#{queue}.user_mailer_confirm_account.processed")
|
161
|
+
context 'when passed as a String' do
|
162
|
+
let(:passed_class) { wrapped_class.to_s }
|
153
163
|
|
154
|
-
|
164
|
+
it 'unwraps the class name and increments the metric' do
|
165
|
+
expect(middleware)
|
166
|
+
.to receive(:increment)
|
167
|
+
.with("sidekiq.#{queue}.user_mailer_confirm_account.processed")
|
168
|
+
|
169
|
+
subject
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
context 'when passed as a Class' do
|
174
|
+
let(:passed_class) { wrapped_class }
|
175
|
+
|
176
|
+
it 'unwraps the class name and increments the metric' do
|
177
|
+
expect(middleware)
|
178
|
+
.to receive(:increment)
|
179
|
+
.with("sidekiq.#{queue}.user_mailer_confirm_account.processed")
|
180
|
+
|
181
|
+
subject
|
182
|
+
end
|
155
183
|
end
|
156
184
|
end
|
157
185
|
|
158
|
-
context "when sidekiq's wrapped class is
|
159
|
-
let(:wrapped_class) { stub_const('
|
186
|
+
context "when sidekiq's wrapped class is not a mail delivery job" do
|
187
|
+
let(:wrapped_class) { stub_const('Jobs::Job', Class.new) }
|
160
188
|
|
161
|
-
|
162
|
-
|
163
|
-
.to receive(:increment)
|
164
|
-
.with("sidekiq.#{queue}.user_mailer_confirm_account.processed")
|
189
|
+
context 'when passed as a String' do
|
190
|
+
let(:passed_class) { wrapped_class.to_s }
|
165
191
|
|
166
|
-
|
192
|
+
it 'unwraps the class name and increments the metric' do
|
193
|
+
expect(middleware)
|
194
|
+
.to receive(:increment)
|
195
|
+
.with("sidekiq.#{queue}.jobs_job.processed")
|
196
|
+
|
197
|
+
subject
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
context 'when passed as a Class' do
|
202
|
+
let(:passed_class) { wrapped_class }
|
203
|
+
|
204
|
+
it 'unwraps the class name and increments the metric' do
|
205
|
+
expect(middleware)
|
206
|
+
.to receive(:increment)
|
207
|
+
.with("sidekiq.#{queue}.jobs_job.processed")
|
208
|
+
|
209
|
+
subject
|
210
|
+
end
|
167
211
|
end
|
168
212
|
end
|
169
213
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-instrumental
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edward Rudd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: instrumental_agent
|
@@ -194,9 +194,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: '2.3'
|
195
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
|
-
- - "
|
197
|
+
- - ">="
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
199
|
+
version: '0'
|
200
200
|
requirements: []
|
201
201
|
rubygems_version: 3.1.6
|
202
202
|
signing_key:
|