appsignal 2.3.3 → 2.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a71ef0ab84d14af51ac3acc5e650ffa795c1f47d
|
4
|
+
data.tar.gz: 5aac40d09039f0489fbba6dd635824854e3de470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a1d8af6158df8b788beedb029af5c8ff73e9240bf9c8f7b1899f32c95138cd291000b6c61786d33f8ec053f9504a14f1e352e1364deb8e7ac132b731359494e
|
7
|
+
data.tar.gz: 15686c8a6ebd22a44ea4a88278876f366010b643bf66218656ca5e7dc1a6cae99e9bfbd1cac46d59db4f2098bcfb11958413a7a08638bf327343e7c1b01acc05
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -15,20 +15,21 @@ module Appsignal
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.invoke_with_instrumentation(job, block)
|
18
|
-
|
19
|
-
|
18
|
+
payload = job.payload_object
|
19
|
+
|
20
|
+
if payload.respond_to? :job_data
|
21
|
+
# ActiveJob
|
22
|
+
job_data = payload.job_data
|
23
|
+
args = job_data.fetch("arguments", {})
|
24
|
+
class_name = job_data["job_class"]
|
25
|
+
method_name = "perform"
|
26
|
+
else
|
27
|
+
# Delayed Job
|
28
|
+
args = extract_value(job.payload_object, :args, {})
|
20
29
|
class_and_method_name = extract_value(job.payload_object, :appsignal_name, job.name)
|
21
30
|
class_name, method_name = class_and_method_name.split("#")
|
22
|
-
args = extract_value(job.payload_object, :args, {})
|
23
|
-
job_data = job
|
24
|
-
elsif job.respond_to?(:job_data)
|
25
|
-
# Via ActiveJob
|
26
|
-
class_name, method_name = job.job_data[:name].split("#")
|
27
|
-
args = job.job_data[:args] || {}
|
28
|
-
job_data = job.job_data
|
29
|
-
else
|
30
|
-
args = {}
|
31
31
|
end
|
32
|
+
|
32
33
|
params = Appsignal::Utils::ParamsSanitizer.sanitize args,
|
33
34
|
:filter_parameters => Appsignal.config[:filter_parameters]
|
34
35
|
|
@@ -37,13 +38,13 @@ module Appsignal
|
|
37
38
|
:class => class_name,
|
38
39
|
:method => method_name,
|
39
40
|
:metadata => {
|
40
|
-
:id => extract_value(
|
41
|
-
:queue => extract_value(
|
42
|
-
:priority => extract_value(
|
43
|
-
:attempts => extract_value(
|
41
|
+
:id => extract_value(job, :id, nil, true),
|
42
|
+
:queue => extract_value(job, :queue),
|
43
|
+
:priority => extract_value(job, :priority, 0),
|
44
|
+
:attempts => extract_value(job, :attempts, 0)
|
44
45
|
},
|
45
46
|
:params => params,
|
46
|
-
:queue_start => extract_value(
|
47
|
+
:queue_start => extract_value(job, :run_at)
|
47
48
|
) do
|
48
49
|
block.call(job)
|
49
50
|
end
|
data/lib/appsignal/version.rb
CHANGED
@@ -215,7 +215,27 @@ describe Appsignal::Hooks::DelayedJobHook do
|
|
215
215
|
require "active_job"
|
216
216
|
|
217
217
|
context "when wrapped by ActiveJob" do
|
218
|
-
let(:
|
218
|
+
let(:wrapped_job) do
|
219
|
+
ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper.new(
|
220
|
+
"arguments" => args,
|
221
|
+
"job_class" => "TestClass",
|
222
|
+
"job_id" => 123,
|
223
|
+
"locale" => :en,
|
224
|
+
"queue_name" => "default"
|
225
|
+
)
|
226
|
+
end
|
227
|
+
let(:job) do
|
228
|
+
double(
|
229
|
+
:id => 123,
|
230
|
+
:name => "ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper",
|
231
|
+
:priority => 1,
|
232
|
+
:attempts => 1,
|
233
|
+
:queue => "default",
|
234
|
+
:created_at => created_at,
|
235
|
+
:run_at => run_at,
|
236
|
+
:payload_object => wrapped_job
|
237
|
+
)
|
238
|
+
end
|
219
239
|
let(:default_params) do
|
220
240
|
{
|
221
241
|
:class => "TestClass",
|
@@ -231,7 +251,6 @@ describe Appsignal::Hooks::DelayedJobHook do
|
|
231
251
|
}
|
232
252
|
end
|
233
253
|
let(:args) { ["activejob_argument"] }
|
234
|
-
before { job_data[:args] = args }
|
235
254
|
|
236
255
|
context "with simple params" do
|
237
256
|
it "wraps it in a transaction with the correct params" do
|
@@ -36,7 +36,7 @@ if DependencyHelper.webmachine_present?
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should set the action" do
|
39
|
-
expect(transaction).to receive(:set_action_if_nil).with("RSpec::Mocks::
|
39
|
+
expect(transaction).to receive(:set_action_if_nil).with("RSpec::Mocks::Double#GET")
|
40
40
|
end
|
41
41
|
|
42
42
|
it "should call the original method" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-09-
|
12
|
+
date: 2017-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|