skylight-core 2.0.2 → 3.0.0.beta
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: 3e088df33cbf4e24299e7348f5590927aa46719f7863d732e2b64bef05e24176
|
4
|
+
data.tar.gz: 1795504557109dcf4f2a0fde7650c3028a19927c52fabbd760107a4f27e7053d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98b4721f8a54536ba50e631eee00f472c3ac06246cc04e958f257a61758d6e52d4fba3710b0b39be5332c35f283a70b8364996d63c92d22c558bc9bc3175f1d4
|
7
|
+
data.tar.gz: b0e322c10dc487abbbaef0088c38728d5c8d1b16756b4ba5f5ce48e847a32b308bdea3c63cdac94880813f4913012e4f3621869f25b4ef597a5753e359a8511e
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Skylight::Core
|
2
|
+
module Probes
|
3
|
+
module ActiveJob
|
4
|
+
class EnqueueProbe
|
5
|
+
CAT = "other.active_job.enqueue".freeze
|
6
|
+
|
7
|
+
def install
|
8
|
+
::ActiveJob::Base.around_enqueue do |job, block|
|
9
|
+
begin
|
10
|
+
job_class = job.class
|
11
|
+
adapter_name = EnqueueProbe.normalize_adapter_name(job_class)
|
12
|
+
desc = "{ adapter: #{adapter_name}, queue: '#{job.queue_name}' }"
|
13
|
+
name = job_class.name
|
14
|
+
rescue
|
15
|
+
block.call
|
16
|
+
else
|
17
|
+
Skylight::Core::Fanout.instrument(
|
18
|
+
title: "Enqueue #{name}", category: CAT, description: desc, &block
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
self.class.instance_eval do
|
24
|
+
if ::ActiveJob.gem_version >= Gem::Version.new('5.2')
|
25
|
+
def normalize_adapter_name(job_class)
|
26
|
+
job_class.queue_adapter_name
|
27
|
+
end
|
28
|
+
else
|
29
|
+
def normalize_adapter_name(job_class)
|
30
|
+
adapter_class = job_class.queue_adapter.is_a?(Class) ? job_class.queue_adapter : job_class.queue_adapter.class
|
31
|
+
adapter_class.name.demodulize.remove('Adapter').underscore
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
register(:active_job_enqueue, "ActiveJob::Base", "active_job/base", ActiveJob::EnqueueProbe.new)
|
40
|
+
end
|
41
|
+
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:
|
4
|
+
version: 3.0.0.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: puma
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: rack-test
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,7 +173,6 @@ files:
|
|
159
173
|
- lib/skylight/core/normalizers/action_view/render_collection.rb
|
160
174
|
- lib/skylight/core/normalizers/action_view/render_partial.rb
|
161
175
|
- lib/skylight/core/normalizers/action_view/render_template.rb
|
162
|
-
- lib/skylight/core/normalizers/active_job/enqueue_at.rb
|
163
176
|
- lib/skylight/core/normalizers/active_model_serializers/render.rb
|
164
177
|
- lib/skylight/core/normalizers/active_record/instantiation.rb
|
165
178
|
- lib/skylight/core/normalizers/active_record/sql.rb
|
@@ -194,6 +207,7 @@ files:
|
|
194
207
|
- lib/skylight/core/probes/action_dispatch.rb
|
195
208
|
- lib/skylight/core/probes/action_dispatch/request_id.rb
|
196
209
|
- lib/skylight/core/probes/action_view.rb
|
210
|
+
- lib/skylight/core/probes/active_job_enqueue.rb
|
197
211
|
- lib/skylight/core/probes/active_model_serializers.rb
|
198
212
|
- lib/skylight/core/probes/elasticsearch.rb
|
199
213
|
- lib/skylight/core/probes/excon.rb
|
@@ -231,7 +245,7 @@ files:
|
|
231
245
|
- lib/skylight/core/vendor/thread_safe/synchronized_cache_backend.rb
|
232
246
|
- lib/skylight/core/version.rb
|
233
247
|
- lib/skylight/core/vm/gc.rb
|
234
|
-
homepage:
|
248
|
+
homepage: https://www.skylight.io
|
235
249
|
licenses:
|
236
250
|
- Nonstandard
|
237
251
|
metadata: {}
|
@@ -246,9 +260,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
246
260
|
version: 2.2.7
|
247
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
248
262
|
requirements:
|
249
|
-
- - "
|
263
|
+
- - ">"
|
250
264
|
- !ruby/object:Gem::Version
|
251
|
-
version:
|
265
|
+
version: 1.3.1
|
252
266
|
requirements: []
|
253
267
|
rubyforge_project:
|
254
268
|
rubygems_version: 2.7.6
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Skylight::Core
|
2
|
-
module Normalizers
|
3
|
-
module ActiveJob
|
4
|
-
class EnqueueAt < Normalizer
|
5
|
-
register "enqueue_at.active_job"
|
6
|
-
|
7
|
-
CAT = "other.job.enqueue_at".freeze
|
8
|
-
|
9
|
-
def normalize(_trace, _name, payload)
|
10
|
-
title = "Enqueue #{payload[:job].class}"
|
11
|
-
|
12
|
-
adapter_class_name = payload[:adapter].class.name
|
13
|
-
adapter_name = adapter_class_name.match(/^ActiveJob::QueueAdapters::(\w+)Adapter$/)[1].underscore
|
14
|
-
desc = "{ adapter: '#{adapter_name}', queue: '#{payload[:job].queue_name}' }"
|
15
|
-
|
16
|
-
[ CAT, title, desc ]
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|