skylight 5.1.0.beta → 5.1.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +390 -371
  3. data/CLA.md +1 -1
  4. data/LICENSE.md +7 -17
  5. data/README.md +1 -1
  6. data/ext/extconf.rb +42 -54
  7. data/lib/skylight.rb +20 -30
  8. data/lib/skylight/api.rb +22 -18
  9. data/lib/skylight/cli.rb +47 -46
  10. data/lib/skylight/cli/doctor.rb +50 -50
  11. data/lib/skylight/cli/helpers.rb +19 -19
  12. data/lib/skylight/cli/merger.rb +141 -139
  13. data/lib/skylight/config.rb +265 -302
  14. data/lib/skylight/deprecation.rb +4 -4
  15. data/lib/skylight/errors.rb +3 -4
  16. data/lib/skylight/extensions.rb +17 -29
  17. data/lib/skylight/extensions/source_location.rb +128 -128
  18. data/lib/skylight/formatters/http.rb +1 -3
  19. data/lib/skylight/gc.rb +30 -40
  20. data/lib/skylight/helpers.rb +43 -41
  21. data/lib/skylight/instrumenter.rb +25 -18
  22. data/lib/skylight/middleware.rb +31 -35
  23. data/lib/skylight/native.rb +8 -10
  24. data/lib/skylight/native_ext_fetcher.rb +10 -12
  25. data/lib/skylight/normalizers.rb +43 -39
  26. data/lib/skylight/normalizers/action_controller/process_action.rb +24 -25
  27. data/lib/skylight/normalizers/action_controller/send_file.rb +7 -6
  28. data/lib/skylight/normalizers/action_dispatch/route_set.rb +7 -7
  29. data/lib/skylight/normalizers/active_job/perform.rb +48 -44
  30. data/lib/skylight/normalizers/active_model_serializers/render.rb +7 -3
  31. data/lib/skylight/normalizers/active_storage.rb +11 -13
  32. data/lib/skylight/normalizers/active_support/cache.rb +1 -12
  33. data/lib/skylight/normalizers/coach/handler_finish.rb +1 -3
  34. data/lib/skylight/normalizers/default.rb +1 -9
  35. data/lib/skylight/normalizers/faraday/request.rb +1 -3
  36. data/lib/skylight/normalizers/grape/endpoint.rb +13 -19
  37. data/lib/skylight/normalizers/grape/endpoint_run.rb +16 -18
  38. data/lib/skylight/normalizers/grape/endpoint_run_filters.rb +1 -3
  39. data/lib/skylight/normalizers/graphql/base.rb +23 -28
  40. data/lib/skylight/normalizers/render.rb +19 -21
  41. data/lib/skylight/normalizers/shrine.rb +15 -17
  42. data/lib/skylight/normalizers/sql.rb +4 -4
  43. data/lib/skylight/probes.rb +38 -46
  44. data/lib/skylight/probes/action_controller.rb +32 -28
  45. data/lib/skylight/probes/action_dispatch/request_id.rb +9 -5
  46. data/lib/skylight/probes/action_dispatch/routing/route_set.rb +7 -5
  47. data/lib/skylight/probes/action_view.rb +9 -10
  48. data/lib/skylight/probes/active_job_enqueue.rb +3 -9
  49. data/lib/skylight/probes/active_model_serializers.rb +8 -8
  50. data/lib/skylight/probes/delayed_job.rb +37 -42
  51. data/lib/skylight/probes/elasticsearch.rb +3 -5
  52. data/lib/skylight/probes/excon.rb +1 -1
  53. data/lib/skylight/probes/excon/middleware.rb +22 -23
  54. data/lib/skylight/probes/graphql.rb +2 -7
  55. data/lib/skylight/probes/middleware.rb +14 -5
  56. data/lib/skylight/probes/mongo.rb +83 -91
  57. data/lib/skylight/probes/net_http.rb +1 -1
  58. data/lib/skylight/probes/redis.rb +5 -17
  59. data/lib/skylight/probes/sequel.rb +7 -11
  60. data/lib/skylight/probes/sinatra.rb +8 -5
  61. data/lib/skylight/probes/tilt.rb +2 -4
  62. data/lib/skylight/railtie.rb +121 -135
  63. data/lib/skylight/sidekiq.rb +4 -5
  64. data/lib/skylight/subscriber.rb +31 -33
  65. data/lib/skylight/test.rb +89 -84
  66. data/lib/skylight/trace.rb +121 -115
  67. data/lib/skylight/user_config.rb +14 -17
  68. data/lib/skylight/util/clock.rb +1 -0
  69. data/lib/skylight/util/component.rb +18 -21
  70. data/lib/skylight/util/deploy.rb +11 -13
  71. data/lib/skylight/util/http.rb +104 -105
  72. data/lib/skylight/util/logging.rb +4 -6
  73. data/lib/skylight/util/lru_cache.rb +2 -6
  74. data/lib/skylight/util/platform.rb +2 -6
  75. data/lib/skylight/util/ssl.rb +1 -3
  76. data/lib/skylight/version.rb +1 -1
  77. data/lib/skylight/vm/gc.rb +1 -9
  78. metadata +4 -4
@@ -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
- if ENV["SKYLIGHT_MUSL"] || `ldd --version 2>&1` =~ /musl/
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 # rubocop:disable Lint/DuplicateBranch
55
+ else
60
56
  "so"
61
57
  end
62
58
 
@@ -12,9 +12,7 @@ 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
15
+ @ca_cert_file = f if f && File.exist?(f)
18
16
  end
19
17
  end
20
18
 
@@ -3,5 +3,5 @@ module Skylight
3
3
  # for compatibility with semver when it is parsed by the rust agent.
4
4
  # This string will be transformed in the gemspec to "5.0.0.alpha"
5
5
  # to conform with rubygems.
6
- VERSION = "5.1.0-beta".freeze
6
+ VERSION = "5.1.0-beta2".freeze
7
7
  end
@@ -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.1.0.beta
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: 2021-04-27 00:00:00.000000000 Z
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,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.13.0
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.13.0
152
+ version: 1.15.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement