skylight 5.0.0.beta → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -6
  3. data/CONTRIBUTING.md +1 -1
  4. data/ext/extconf.rb +2 -2
  5. data/ext/libskylight.yml +7 -5
  6. data/lib/skylight.rb +9 -2
  7. data/lib/skylight/api.rb +3 -0
  8. data/lib/skylight/cli/doctor.rb +11 -13
  9. data/lib/skylight/config.rb +25 -32
  10. data/lib/skylight/deprecation.rb +3 -1
  11. data/lib/skylight/errors.rb +4 -4
  12. data/lib/skylight/extensions.rb +8 -0
  13. data/lib/skylight/extensions/source_location.rb +123 -81
  14. data/lib/skylight/formatters/http.rb +2 -1
  15. data/lib/skylight/helpers.rb +44 -35
  16. data/lib/skylight/instrumenter.rb +3 -2
  17. data/lib/skylight/middleware.rb +4 -4
  18. data/lib/skylight/native.rb +1 -1
  19. data/lib/skylight/native_ext_fetcher.rb +2 -2
  20. data/lib/skylight/normalizers.rb +6 -4
  21. data/lib/skylight/normalizers/action_controller/process_action.rb +1 -1
  22. data/lib/skylight/normalizers/action_dispatch/route_set.rb +1 -1
  23. data/lib/skylight/normalizers/active_job/perform.rb +5 -0
  24. data/lib/skylight/normalizers/graphql/base.rb +1 -0
  25. data/lib/skylight/normalizers/render.rb +1 -1
  26. data/lib/skylight/normalizers/shrine.rb +34 -0
  27. data/lib/skylight/normalizers/sql.rb +3 -2
  28. data/lib/skylight/probes.rb +38 -10
  29. data/lib/skylight/probes/active_job.rb +4 -6
  30. data/lib/skylight/probes/active_job_enqueue.rb +18 -14
  31. data/lib/skylight/probes/active_model_serializers.rb +2 -6
  32. data/lib/skylight/probes/delayed_job.rb +112 -25
  33. data/lib/skylight/probes/elasticsearch.rb +1 -1
  34. data/lib/skylight/probes/excon/middleware.rb +4 -4
  35. data/lib/skylight/probes/middleware.rb +2 -1
  36. data/lib/skylight/probes/mongo.rb +2 -1
  37. data/lib/skylight/probes/net_http.rb +0 -1
  38. data/lib/skylight/probes/redis.rb +6 -3
  39. data/lib/skylight/railtie.rb +1 -1
  40. data/lib/skylight/sidekiq.rb +12 -7
  41. data/lib/skylight/subscriber.rb +1 -1
  42. data/lib/skylight/trace.rb +10 -4
  43. data/lib/skylight/util/deploy.rb +3 -6
  44. data/lib/skylight/util/instrumenter_method.rb +11 -11
  45. data/lib/skylight/util/logging.rb +6 -6
  46. data/lib/skylight/util/lru_cache.rb +1 -3
  47. data/lib/skylight/util/platform.rb +1 -1
  48. data/lib/skylight/version.rb +1 -1
  49. metadata +27 -13
  50. data/lib/skylight/fanout.rb +0 -0
@@ -9,12 +9,12 @@ module Skylight
9
9
  end
10
10
 
11
11
  def write(*args)
12
- STDERR.write(*args)
12
+ $stderr.write(*args)
13
13
 
14
14
  # Try to avoid writing to STDOUT/STDERR twice
15
15
  logger_logdev = @logger.instance_variable_get(:@logdev)
16
- logger_out = logger_logdev&.respond_to?(:dev) ? logger_logdev.dev : nil
17
- if logger_out != STDOUT && logger_out != STDERR
16
+ logger_out = logger_logdev.respond_to?(:dev) ? logger_logdev.dev : nil
17
+ if logger_out != $stdout && logger_out != $stderr
18
18
  @logger.<<(*args)
19
19
  end
20
20
  end
@@ -114,10 +114,10 @@ module Skylight
114
114
 
115
115
  if logger
116
116
  if logger.respond_to?(level)
117
- if !args.empty?
118
- logger.send level, format(msg, *args)
119
- else
117
+ if args.empty?
120
118
  logger.send level, msg
119
+ else
120
+ logger.send level, format(msg, *args)
121
121
  end
122
122
  return # rubocop:disable Style/RedundantReturn
123
123
  else
@@ -11,9 +11,7 @@ module Skylight
11
11
  raise ArgumentError, :max_size if @max_size < 1
12
12
 
13
13
  @max_size = size
14
- while @data.size > @max_size
15
- @data.shift
16
- end
14
+ @data.shift while @data.size > @max_size
17
15
  end
18
16
 
19
17
  # Individual hash operations here are atomic in MRI.
@@ -56,7 +56,7 @@ module Skylight
56
56
  "so"
57
57
  when /windows|cygwin/
58
58
  "dll"
59
- else
59
+ else # rubocop:disable Lint/DuplicateBranch
60
60
  "so"
61
61
  end
62
62
 
@@ -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.0.0-beta".freeze
6
+ VERSION = "5.0.0".freeze
7
7
  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.0.0.beta
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-06 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 12.3.3
89
+ version: 13.0.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 12.3.3
96
+ version: 13.0.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake-compiler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.0.4
103
+ version: 1.1.1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.0.4
110
+ version: 1.1.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,28 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.79.0
145
+ version: 1.11.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: 0.79.0
152
+ version: 1.11.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
@@ -211,7 +225,6 @@ files:
211
225
  - lib/skylight/errors.rb
212
226
  - lib/skylight/extensions.rb
213
227
  - lib/skylight/extensions/source_location.rb
214
- - lib/skylight/fanout.rb
215
228
  - lib/skylight/formatters/http.rb
216
229
  - lib/skylight/gc.rb
217
230
  - lib/skylight/helpers.rb
@@ -261,6 +274,7 @@ files:
261
274
  - lib/skylight/normalizers/graphql/base.rb
262
275
  - lib/skylight/normalizers/render.rb
263
276
  - lib/skylight/normalizers/sequel/sql.rb
277
+ - lib/skylight/normalizers/shrine.rb
264
278
  - lib/skylight/normalizers/sql.rb
265
279
  - lib/skylight/probes.rb
266
280
  - lib/skylight/probes/action_controller.rb
@@ -361,14 +375,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
361
375
  requirements:
362
376
  - - ">="
363
377
  - !ruby/object:Gem::Version
364
- version: '2.4'
378
+ version: '2.5'
365
379
  required_rubygems_version: !ruby/object:Gem::Requirement
366
380
  requirements:
367
- - - ">"
381
+ - - ">="
368
382
  - !ruby/object:Gem::Version
369
- version: 1.3.1
383
+ version: '0'
370
384
  requirements: []
371
- rubygems_version: 3.1.2
385
+ rubygems_version: 3.2.3
372
386
  signing_key:
373
387
  specification_version: 4
374
388
  summary: Skylight is a smart profiler for Rails, Sinatra, and other Ruby apps.
File without changes