skylight-core 3.1.3 → 3.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df3ec461ddd41697f525347a5321300d4c4fd414466405edf173bd8224f8422d
|
4
|
+
data.tar.gz: b8d4602521b419866e94d1799639331e49fa256e550af7806cdc4a5e6aa057cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddda351c0978c6f3114ecc7fe2dc1a05ea38754931cdf7574c3534112c35928a862bfe99ee740a18d678e78976d6066cc6b81eaeb531ded763679a511b773c90
|
7
|
+
data.tar.gz: 6513777f0659db9ea52c9b29487358efa45a9642170cabb76f4b82d8efca467f8ee38e5980ba3ce7ee5f934f9192d78fc54950a20c709f27dab7f9782832e9f4
|
@@ -7,17 +7,18 @@ module Skylight::Core
|
|
7
7
|
CAT = "app.job.perform".freeze
|
8
8
|
|
9
9
|
def normalize(trace, _name, payload)
|
10
|
-
title =
|
10
|
+
title = normalize_title(payload[:job])
|
11
11
|
adapter_name = normalize_adapter_name(payload[:adapter])
|
12
12
|
desc = "{ adapter: '#{adapter_name}', queue: '#{payload[:job].queue_name}' }"
|
13
13
|
|
14
|
-
trace.endpoint = title
|
14
|
+
trace.endpoint = title if assign_endpoint?(trace, payload)
|
15
15
|
|
16
16
|
[ CAT, title, desc ]
|
17
17
|
end
|
18
18
|
|
19
19
|
def normalize_after(trace, _span, _name, payload)
|
20
|
-
return unless config.enable_segments?
|
20
|
+
return unless config.enable_segments? && assign_endpoint?(trace, payload)
|
21
|
+
|
21
22
|
trace.endpoint += "<sk-segment>#{payload[:job].queue_name}</sk-segment>"
|
22
23
|
end
|
23
24
|
|
@@ -29,6 +30,17 @@ module Skylight::Core
|
|
29
30
|
rescue
|
30
31
|
'active_job'
|
31
32
|
end
|
33
|
+
|
34
|
+
def assign_endpoint?(trace, payload)
|
35
|
+
return false unless defined?(Skylight::Core::Probes::ActiveJob::Probe::TITLE)
|
36
|
+
|
37
|
+
trace.endpoint == Skylight::Core::Probes::ActiveJob::Probe::TITLE ||
|
38
|
+
trace.endpoint == normalize_title(payload[:job])
|
39
|
+
end
|
40
|
+
|
41
|
+
def normalize_title(job_instance)
|
42
|
+
"#{job_instance.class}"
|
43
|
+
end
|
32
44
|
end
|
33
45
|
end
|
34
46
|
end
|
@@ -2,12 +2,14 @@ module Skylight::Core
|
|
2
2
|
module Probes
|
3
3
|
module ActiveJob
|
4
4
|
class Probe
|
5
|
+
TITLE = 'ActiveJob.execute'.freeze
|
6
|
+
|
5
7
|
def install
|
6
8
|
::ActiveJob::Base.instance_eval do
|
7
9
|
alias execute_without_sk execute
|
8
10
|
|
9
11
|
def execute(*args)
|
10
|
-
Skylight.trace(
|
12
|
+
Skylight.trace(TITLE, 'app.job.execute') do
|
11
13
|
execute_without_sk(*args)
|
12
14
|
end
|
13
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -267,8 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
- !ruby/object:Gem::Version
|
268
268
|
version: '0'
|
269
269
|
requirements: []
|
270
|
-
|
271
|
-
rubygems_version: 2.7.6
|
270
|
+
rubygems_version: 3.0.2
|
272
271
|
signing_key:
|
273
272
|
specification_version: 4
|
274
273
|
summary: The core methods of the Skylight profiler.
|