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: '06889a19d37ec9b12ae47c1644a8d8eda1f01328caeed931a5c4459e8efff6b0'
4
- data.tar.gz: e4a6317fd536c10e97949a0a1bb76dc8fd3b8b7ee78e75e67cea8e199097894c
3
+ metadata.gz: df3ec461ddd41697f525347a5321300d4c4fd414466405edf173bd8224f8422d
4
+ data.tar.gz: b8d4602521b419866e94d1799639331e49fa256e550af7806cdc4a5e6aa057cd
5
5
  SHA512:
6
- metadata.gz: 871356b1ff5214e0a322798bca7749e2e8f8081cf0fad3611dc35cd98f18ea922650c03c9e0be6fed5197f3fee77e69bf36f9230069150ff2633c971c1bfae3d
7
- data.tar.gz: c265c61910a054232d749b34de7f406c12c4f86c779a5873c2f19264f9d6987f26b73badd234f5b04b8857d58f043118938e2cd9e0ab83e6ad153ae580e19790
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 = "#{payload[:job].class}"
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('ActiveJob.execute', 'app.job.execute') do
12
+ Skylight.trace(TITLE, 'app.job.execute') do
11
13
  execute_without_sk(*args)
12
14
  end
13
15
  end
@@ -1,6 +1,6 @@
1
1
  module Skylight
2
2
  module Core
3
- VERSION = '3.1.3'
3
+ VERSION = '3.1.4'
4
4
  end
5
5
  end
6
6
 
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.3
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-23 00:00:00.000000000 Z
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
- rubyforge_project:
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.