skylight 5.0.0.beta4 → 5.1.0.beta2
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 +4 -4
- data/CHANGELOG.md +399 -362
- data/CLA.md +1 -1
- data/CONTRIBUTING.md +1 -1
- data/LICENSE.md +7 -17
- data/README.md +1 -1
- data/ext/extconf.rb +42 -54
- data/ext/libskylight.yml +10 -5
- data/lib/skylight.rb +20 -30
- data/lib/skylight/api.rb +22 -18
- data/lib/skylight/cli.rb +47 -46
- data/lib/skylight/cli/doctor.rb +50 -50
- data/lib/skylight/cli/helpers.rb +19 -19
- data/lib/skylight/cli/merger.rb +141 -139
- data/lib/skylight/config.rb +267 -310
- data/lib/skylight/deprecation.rb +4 -4
- data/lib/skylight/errors.rb +3 -4
- data/lib/skylight/extensions.rb +17 -29
- data/lib/skylight/extensions/source_location.rb +128 -128
- data/lib/skylight/formatters/http.rb +1 -3
- data/lib/skylight/gc.rb +30 -40
- data/lib/skylight/helpers.rb +57 -30
- data/lib/skylight/instrumenter.rb +25 -18
- data/lib/skylight/middleware.rb +31 -35
- data/lib/skylight/native.rb +8 -10
- data/lib/skylight/native_ext_fetcher.rb +10 -12
- data/lib/skylight/normalizers.rb +43 -38
- data/lib/skylight/normalizers/action_controller/process_action.rb +24 -25
- data/lib/skylight/normalizers/action_controller/send_file.rb +7 -6
- data/lib/skylight/normalizers/action_dispatch/route_set.rb +7 -7
- data/lib/skylight/normalizers/active_job/perform.rb +48 -44
- data/lib/skylight/normalizers/active_model_serializers/render.rb +7 -3
- data/lib/skylight/normalizers/active_storage.rb +11 -13
- data/lib/skylight/normalizers/active_support/cache.rb +1 -12
- data/lib/skylight/normalizers/coach/handler_finish.rb +1 -3
- data/lib/skylight/normalizers/default.rb +1 -9
- data/lib/skylight/normalizers/faraday/request.rb +1 -3
- data/lib/skylight/normalizers/grape/endpoint.rb +13 -19
- data/lib/skylight/normalizers/grape/endpoint_run.rb +16 -18
- data/lib/skylight/normalizers/grape/endpoint_run_filters.rb +1 -3
- data/lib/skylight/normalizers/graphql/base.rb +23 -28
- data/lib/skylight/normalizers/render.rb +19 -21
- data/lib/skylight/normalizers/shrine.rb +32 -0
- data/lib/skylight/normalizers/sql.rb +4 -4
- data/lib/skylight/probes.rb +38 -46
- data/lib/skylight/probes/action_controller.rb +32 -28
- data/lib/skylight/probes/action_dispatch/request_id.rb +9 -5
- data/lib/skylight/probes/action_dispatch/routing/route_set.rb +7 -5
- data/lib/skylight/probes/action_view.rb +9 -10
- data/lib/skylight/probes/active_job_enqueue.rb +3 -9
- data/lib/skylight/probes/active_model_serializers.rb +8 -8
- data/lib/skylight/probes/delayed_job.rb +37 -42
- data/lib/skylight/probes/elasticsearch.rb +4 -6
- data/lib/skylight/probes/excon.rb +1 -1
- data/lib/skylight/probes/excon/middleware.rb +22 -23
- data/lib/skylight/probes/graphql.rb +2 -7
- data/lib/skylight/probes/middleware.rb +14 -5
- data/lib/skylight/probes/mongo.rb +83 -91
- data/lib/skylight/probes/net_http.rb +1 -1
- data/lib/skylight/probes/redis.rb +5 -17
- data/lib/skylight/probes/sequel.rb +7 -11
- data/lib/skylight/probes/sinatra.rb +8 -5
- data/lib/skylight/probes/tilt.rb +2 -4
- data/lib/skylight/railtie.rb +121 -135
- data/lib/skylight/sidekiq.rb +4 -5
- data/lib/skylight/subscriber.rb +31 -33
- data/lib/skylight/test.rb +89 -84
- data/lib/skylight/trace.rb +121 -115
- data/lib/skylight/user_config.rb +14 -17
- data/lib/skylight/util/clock.rb +1 -0
- data/lib/skylight/util/component.rb +18 -21
- data/lib/skylight/util/deploy.rb +11 -13
- data/lib/skylight/util/http.rb +104 -105
- data/lib/skylight/util/logging.rb +4 -6
- data/lib/skylight/util/lru_cache.rb +2 -6
- data/lib/skylight/util/platform.rb +2 -6
- data/lib/skylight/util/ssl.rb +1 -25
- data/lib/skylight/version.rb +1 -1
- data/lib/skylight/vm/gc.rb +1 -9
- metadata +20 -5
@@ -19,15 +19,11 @@ module Skylight
|
|
19
19
|
found = true
|
20
20
|
value = @data.delete(key) { found = false }
|
21
21
|
|
22
|
-
if !found && block_given?
|
23
|
-
value = yield
|
24
|
-
end
|
22
|
+
value = yield if !found && block_given?
|
25
23
|
|
26
24
|
@data[key] = value if value
|
27
25
|
|
28
|
-
if !found && value && @data.length > @max_size
|
29
|
-
@data.shift
|
30
|
-
end
|
26
|
+
@data.shift if !found && value && @data.length > @max_size
|
31
27
|
|
32
28
|
value
|
33
29
|
end
|
@@ -12,11 +12,7 @@ module Skylight
|
|
12
12
|
# Ruby doesn't know that it's on a musl-based platform. `ldd` is the
|
13
13
|
# only reliable way to detect musl that we've found.
|
14
14
|
# See https://github.com/skylightio/skylight-ruby/issues/92
|
15
|
-
|
16
|
-
"linux-musl"
|
17
|
-
else
|
18
|
-
"linux"
|
19
|
-
end
|
15
|
+
ENV["SKYLIGHT_MUSL"] || `ldd --version 2>&1` =~ /musl/ ? "linux-musl" : "linux"
|
20
16
|
when /darwin/
|
21
17
|
"darwin"
|
22
18
|
when /freebsd/
|
@@ -56,7 +52,7 @@ module Skylight
|
|
56
52
|
"so"
|
57
53
|
when /windows|cygwin/
|
58
54
|
"dll"
|
59
|
-
else
|
55
|
+
else
|
60
56
|
"so"
|
61
57
|
end
|
62
58
|
|
data/lib/skylight/util/ssl.rb
CHANGED
@@ -12,43 +12,19 @@ module Skylight
|
|
12
12
|
if defined?(OpenSSL::X509::DEFAULT_CERT_FILE)
|
13
13
|
f = OpenSSL::X509::DEFAULT_CERT_FILE
|
14
14
|
|
15
|
-
if f && File.exist?(f)
|
16
|
-
@ca_cert_file = f
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.detect_ca_cert_dir!
|
22
|
-
return nil if ENV["SKYLIGHT_FORCE_OWN_CERTS"]
|
23
|
-
|
24
|
-
@ca_cert_dir = false
|
25
|
-
if defined?(OpenSSL::X509::DEFAULT_CERT_DIR)
|
26
|
-
d = OpenSSL::X509::DEFAULT_CERT_DIR
|
27
|
-
|
28
|
-
if d && File.exist?(d)
|
29
|
-
@ca_cert_dir = d
|
30
|
-
end
|
15
|
+
@ca_cert_file = f if f && File.exist?(f)
|
31
16
|
end
|
32
17
|
end
|
33
18
|
|
34
19
|
detect_ca_cert_file!
|
35
|
-
detect_ca_cert_dir!
|
36
20
|
|
37
21
|
def self.ca_cert_file?
|
38
22
|
!!@ca_cert_file
|
39
23
|
end
|
40
24
|
|
41
|
-
def self.ca_cert_dir?
|
42
|
-
!!@ca_cert_dir
|
43
|
-
end
|
44
|
-
|
45
25
|
def self.ca_cert_file_or_default
|
46
26
|
@ca_cert_file || DEFAULT_CA_FILE
|
47
27
|
end
|
48
|
-
|
49
|
-
class << self
|
50
|
-
attr_reader :ca_cert_dir
|
51
|
-
end
|
52
28
|
end
|
53
29
|
end
|
54
30
|
end
|
data/lib/skylight/version.rb
CHANGED
data/lib/skylight/vm/gc.rb
CHANGED
@@ -2,7 +2,6 @@ module Skylight
|
|
2
2
|
# @api private
|
3
3
|
module VM
|
4
4
|
if defined?(JRUBY_VERSION)
|
5
|
-
|
6
5
|
# This doesn't quite work as we would like it. I believe that the GC
|
7
6
|
# statistics includes time that is not stop-the-world, this does not
|
8
7
|
# necessarily take time away from the application.
|
@@ -26,9 +25,7 @@ module Skylight
|
|
26
25
|
# res
|
27
26
|
# end
|
28
27
|
# end
|
29
|
-
|
30
28
|
elsif defined?(::GC::Profiler)
|
31
|
-
|
32
29
|
class GC
|
33
30
|
def initialize
|
34
31
|
@total = 0
|
@@ -42,19 +39,15 @@ module Skylight
|
|
42
39
|
# Reported in seconds
|
43
40
|
run = (::GC::Profiler.total_time * 1_000_000).to_i
|
44
41
|
|
45
|
-
if run > 0
|
46
|
-
::GC::Profiler.clear
|
47
|
-
end
|
42
|
+
::GC::Profiler.clear if run > 0
|
48
43
|
|
49
44
|
@total += run
|
50
45
|
end
|
51
46
|
end
|
52
|
-
|
53
47
|
end
|
54
48
|
|
55
49
|
# Fallback
|
56
50
|
unless defined?(VM::GC)
|
57
|
-
|
58
51
|
class GC
|
59
52
|
def enable; end
|
60
53
|
|
@@ -62,7 +55,6 @@ module Skylight
|
|
62
55
|
0
|
63
56
|
end
|
64
57
|
end
|
65
|
-
|
66
58
|
end
|
67
59
|
end
|
68
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.1.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -142,14 +142,28 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.15.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.15.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: simplecov
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.21.2
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.21.2
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: timecop
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -260,6 +274,7 @@ files:
|
|
260
274
|
- lib/skylight/normalizers/graphql/base.rb
|
261
275
|
- lib/skylight/normalizers/render.rb
|
262
276
|
- lib/skylight/normalizers/sequel/sql.rb
|
277
|
+
- lib/skylight/normalizers/shrine.rb
|
263
278
|
- lib/skylight/normalizers/sql.rb
|
264
279
|
- lib/skylight/probes.rb
|
265
280
|
- lib/skylight/probes/action_controller.rb
|
@@ -367,7 +382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
367
382
|
- !ruby/object:Gem::Version
|
368
383
|
version: 1.3.1
|
369
384
|
requirements: []
|
370
|
-
rubygems_version: 3.
|
385
|
+
rubygems_version: 3.2.15
|
371
386
|
signing_key:
|
372
387
|
specification_version: 4
|
373
388
|
summary: Skylight is a smart profiler for Rails, Sinatra, and other Ruby apps.
|