rails-profiler 0.30.4 → 0.30.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2940fc44efea04a648f7bba562f2fc19be1639d996525e9d08483ef7093baa16
4
- data.tar.gz: 1b9f6534d20625950aef62f906319942d7327ea609649aef00b70ba88c9b17ce
3
+ metadata.gz: 04defc47e71c610492ff23fbce13ebf669f459a1cac74c5933200bdf4d52365c
4
+ data.tar.gz: d99cf7c5531fd369aa8c9367d95b0a5314f71f38de6ed64a7c81a9693f69566a
5
5
  SHA512:
6
- metadata.gz: 6ce1584ab5b3d70a6262d205cfbd0e4876d29e89b3766efde13fe345966734c20f6a73df1fe1e14b71f7b8af5c588b04e02c7e9a8b16a0f00c902ff8f5a55aa6
7
- data.tar.gz: 6e02c794a279605d81ac11c5f31f099378af2d82c967e757bf571ce2ff27ec7ca3f7c342f7e90cca628c5a406c253b0f0252971a723d0c4970db86ec35bd5c4e
6
+ metadata.gz: '09ba67258286ddc275d2d1cc36234dd8f0e7d24783034dd3959c666b41d96bb334d5c38d720ceca2254d205449094aa57cac9de6afb1842e3437fbd2d238eac3'
7
+ data.tar.gz: '0936d7ca150be6a80809739a2d9b94f77c51c80fad8796bb01d93fb2ca0047a5da3eb4ae832f9567c381bd3dcaacad3000b0273664362570306060c8b3b3eeec'
data/CHANGELOG.md ADDED
@@ -0,0 +1,402 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ Write your entry under `[Unreleased]`, for a user of the gem. When your branch is
9
+ ready, run `bin/changelog stamp`: it works out the version the merge will publish
10
+ and turns `[Unreleased]` into `[X.Y.Z] - <date>`, reopening an empty one above.
11
+ Run it again after a rebase or a new commit, it corrects the number and folds the
12
+ new entries in. Never edit a section that already carries a tag.
13
+
14
+ A section written by `stamp` carries `<!-- stamped -->`. In the older sections,
15
+ each bullet carries the short sha of the commit it describes, and commits left out
16
+ on purpose are listed in that version's `excluded:` comment with the reason; all of
17
+ it in HTML comments, invisible once rendered. `bin/changelog coverage` checks that
18
+ every commit of every tag interval is accounted for one way or the other.
19
+
20
+ ## [Unreleased]
21
+
22
+ ## [0.30.5] - 2026-10-03
23
+
24
+ <!-- stamped -->
25
+
26
+ ### Fixed
27
+
28
+ - **Instrumentation:** Pass the arguments of `Thread.new` on to its block, and keep keyword
29
+ arguments as keywords. While a profile was being collected the block got none at all, which on
30
+ Ruby 3.4 broke the Happy Eyeballs hostname resolution of `Socket.tcp`: connections by hostname
31
+ timed out, for example as `Redis::CannotConnectError`. Keyword arguments were flattened at all
32
+ times, on every Ruby. Affects v0.22.1 through v0.30.4.
33
+ - **Instrumentation:** Raise `ThreadError` on a `Thread.new` with no block during a profiled
34
+ request, as Ruby does.
35
+
36
+ ## [0.30.4] - 2026-07-01
37
+
38
+ ### Fixed
39
+
40
+ - **Cluster:** Resolve profiles across slaves from the master `ProfilesController` <!-- 9236c4c -->
41
+
42
+ ## [0.30.3] - 2026-06-29
43
+
44
+ ### Fixed
45
+
46
+ - Wrap the profile dashboards and `TestRunnerPage` with `QueryClientProvider` <!-- 420ae2f -->
47
+
48
+ ## [0.30.2] - 2026-06-29
49
+
50
+ ### Fixed
51
+
52
+ - **Middleware:** Duplicate downstream headers before mutating them <!-- 3efb20c -->
53
+
54
+ ## [0.30.1] - 2026-06-29
55
+
56
+ ### Fixed
57
+
58
+ - **Cluster:** Fix sentinel mismatch, profile list pagination, nil safety in MCP tools and HTTPS slave URLs <!-- 4b5fb1c -->
59
+
60
+ ## [0.30.0] - 2026-06-28
61
+
62
+ ### Added
63
+
64
+ - **Cluster:** Add master/slave profiler clustering <!-- 1435f22 -->
65
+
66
+ ## [0.29.0] - 2026-06-28
67
+
68
+ ### Added
69
+
70
+ - **SSE:** Push live profile updates over server-sent events <!-- fa0ae2e -->
71
+
72
+ ## [0.28.0] - 2026-06-06
73
+
74
+ ### Added
75
+
76
+ - **HTTP:** Add the `http_backtrace_depth` configuration option <!-- 25b4f99 -->
77
+
78
+ ## [0.27.1] - 2026-06-06
79
+
80
+ ### Changed
81
+
82
+ - **API:** Replace manual `fetch()` calls with `orval` generated TanStack Query hooks <!-- e33341e -->
83
+
84
+ ### Fixed
85
+
86
+ - **File store:** Prevent `ENOENT` errors on concurrent profile file deletion <!-- 8898f0e -->
87
+
88
+ ## [0.27.0] - 2026-06-02
89
+
90
+ ### Added
91
+
92
+ - **MCP:** Add console profiling, mailer detail, logs/env/i18n sections and full documentation <!-- ca362a1 -->
93
+
94
+ ## [0.26.0] - 2026-06-02
95
+
96
+ ### Added
97
+
98
+ - **Test profiler:** Add the `run_tests` MCP tool, the `track_tests` option, specs and docs <!-- 265ce03 -->
99
+ - **Test profiler:** Enrich reporter, add SSE streaming, MCP tools and env safety <!-- a410c4b -->
100
+ - **Test profiler:** Add test profiling, test runner UI and MCP tool <!-- a116fcb -->
101
+
102
+ ## [0.25.0] - 2026-06-01
103
+
104
+ ### Added
105
+
106
+ - **Console:** Add a console profiling tab with IRB instrumentation <!-- f29937a -->
107
+
108
+ ### Changed
109
+
110
+ - **Docs:** Document the console profiling tab and the env override behaviour <!-- 031cac6 -->
111
+
112
+ <!-- excluded:
113
+ bd55e9b specs only, no visible change
114
+ -->
115
+
116
+ ## [0.24.0] - 2026-06-01
117
+
118
+ ### Added
119
+
120
+ - **MCP:** Add tools to manage `ENV` variables <!-- 9126194 -->
121
+
122
+ ## [0.23.0] - 2026-05-27
123
+
124
+ ### Added
125
+
126
+ - **Profile list:** Add a global clear-all button and auto-refresh on tab switch <!-- 460a110 -->
127
+
128
+ ## [0.22.1] - 2026-05-26
129
+
130
+ ### Fixed
131
+
132
+ - **HTTP:** Propagate collector to child threads, add fire-and-forget support, fix deep backtrace capture <!-- 9d0bd61 -->
133
+
134
+ ## [0.22.0] - 2026-05-04
135
+
136
+ ### Added
137
+
138
+ - **Mailer:** Add a body preview, a variables display, a queued badge and design alignment <!-- b7d608f -->
139
+ - **Collector:** Implement `MailerCollector`, tracking ActionMailer deliveries <!-- e59dd72 -->
140
+
141
+ ### Changed
142
+
143
+ - **Toolbar:** Remove the emoji from the mailer toolbar item and the dashboard tab <!-- 55df9bb -->
144
+
145
+ ### Fixed
146
+
147
+ - **Mailer:** Add the Mailers tab to `JobProfileDashboard` <!-- 4ce145d -->
148
+ - **Mailer:** Fix thread isolation and `deliver_later` mode detection <!-- 6e76a99 -->
149
+ - **Mailer:** Add `MailerCollector` to the job profiler and align the toolbar item design <!-- 915be28 -->
150
+ - **Mailer:** Handle the Rails 7 encoded mail string in the `deliver.action_mailer` payload <!-- 5479dcf -->
151
+ - **Mailer:** Replace `Thread.current.delete` with a read and nil write for fiber local variables <!-- 8787201 -->
152
+ - **Version:** Remove the pre-release suffix, which broke Bundler resolution <!-- 98caecd -->
153
+ - **Mailer:** Address code review findings from MR !32 <!-- b46d3d2 -->
154
+
155
+ ## [0.21.0] - 2026-05-02
156
+
157
+ ### Added
158
+
159
+ - **Toolbar:** Add a collapse/expand toggle <!-- 8f0669a -->
160
+
161
+ ## [0.20.0] - 2026-05-01
162
+
163
+ ### Added
164
+
165
+ - **UI:** Display the gem version and warn on a mismatch <!-- 64ff6eb -->
166
+
167
+ ## [0.19.2] - 2026-04-24
168
+
169
+ ### Fixed
170
+
171
+ - **HTTP:** Capture `RestClient` `body_stream`, remove body size limits, show bodies in MCP tool results <!-- 89fb0e5 -->
172
+
173
+ <!-- excluded:
174
+ 4527e12 release plumbing, version placeholder reset
175
+ -->
176
+
177
+ ## [0.19.1] - 2026-04-17
178
+
179
+ ### Fixed
180
+
181
+ - **Env vars:** Fix revert restoring wrong value, SQLite busy errors, middleware rescue handling and UI refresh <!-- 55c8661 -->
182
+
183
+ <!-- excluded:
184
+ 4637391 pipeline only
185
+ b53b4d7 pipeline only
186
+ 7b33bf6 pipeline only
187
+ -->
188
+
189
+ ## [0.19.0] - 2026-04-15
190
+
191
+ ### Added
192
+
193
+ - **Env:** Propagate env var overrides to Sidekiq workers <!-- e75a883 -->
194
+
195
+ ## [0.18.0] - 2026-04-14
196
+
197
+ ### Changed
198
+
199
+ - **UI:** Extract shared tab utilities and redesign the Request tab <!-- 7aa8adb -->
200
+
201
+ ### Fixed
202
+
203
+ - **HTTP:** Capture outbound request body passed as second argument to `http.request()` <!-- 5a59665 -->
204
+
205
+ ## [0.17.0] - 2026-04-13
206
+
207
+ ### Added
208
+
209
+ - **Dashboard:** Add env tab on the home page and env/job toolbar items <!-- d0277ab -->
210
+
211
+ ## [0.16.0] - 2026-04-13
212
+
213
+ ### Added
214
+
215
+ - **Function profiler:** Add `stackprof` sampling mode with multi-clock support and GC visibility <!-- 5f73512 -->
216
+
217
+ ### Fixed
218
+
219
+ - **Function profiler:** Fix `stackprof` bugs, remove minimal mode, improve performance <!-- 76c6197 -->
220
+
221
+ ## [0.15.0] - 2026-04-11
222
+
223
+ ### Added
224
+
225
+ - **Env:** Add environment variables tab <!-- 0e85f18 -->
226
+
227
+ ## [0.14.0] - 2026-04-09
228
+
229
+ ### Added
230
+
231
+ - **Profiler:** Link jobs to their triggering request or parent job <!-- 74ba5e3 -->
232
+
233
+ ## [0.13.0] - 2026-04-09
234
+
235
+ ### Added
236
+
237
+ - **UI:** Add copy/download buttons on HTTP bodies, waterfall view, date sort, and other UX improvements <!-- 5afd003 -->
238
+ - **UI:** Always show waterfall above the HTTP request list <!-- 32c6b6d -->
239
+ - **UI:** Use `SmartBodyPreview` in RequestTab for copy/download on request and response bodies <!-- aef4c0c -->
240
+
241
+ ### Fixed
242
+
243
+ - **UI:** Derive download file extension from actual MIME type instead of body category <!-- 1dc0bc8 -->
244
+ - **UI:** Move `sortedJobs` after `filteredJobs` to fix TDZ error <!-- d4de7bc -->
245
+
246
+ ## [0.12.0] - 2026-04-09
247
+
248
+ ### Added
249
+
250
+ - **Profiler:** Add function-level profiling with flamegraph and stats table <!-- fcb04a6 -->
251
+
252
+ ## [0.11.1] - 2026-04-09
253
+
254
+ ### Added
255
+
256
+ - **Config:** Add `tmp_path` option to centralize the storage directory <!-- 5e77944 -->
257
+
258
+ ### Fixed
259
+
260
+ - **MCP:** Decompress gzip+base64 bodies before returning to UI and MCP tool results <!-- 8f5ac47 -->
261
+
262
+ ## [0.11.0] - 2026-04-06
263
+
264
+ ### Added
265
+
266
+ - **UI:** Add load-more pagination to the profile list <!-- 9f8458b -->
267
+
268
+ ## [0.10.1] - 2026-04-06
269
+
270
+ ### Changed
271
+
272
+ - **Docs:** Add full user documentation, with a UI guide, an MCP guide and screenshots <!-- 80a9198 -->
273
+
274
+ ## [0.10.0] - 2026-04-06
275
+
276
+ ### Added
277
+
278
+ - **Middleware:** Add configurable CORS origins, CSP nonce support and body compression <!-- 3a42188 -->
279
+
280
+ ## [0.9.1] - 2026-04-06
281
+
282
+ ### Removed
283
+
284
+ - **Collectors:** Remove `PerformanceCollector`, replaced by `FlameGraphCollector` <!-- 212e155 -->
285
+
286
+ ## [0.9.0] - 2026-04-06
287
+
288
+ ### Added
289
+
290
+ - **Profiler:** Add the `Profiler.measure` custom instrumentation API <!-- 0a3044e -->
291
+
292
+ ## [0.8.0] - 2026-04-05
293
+
294
+ ### Added
295
+
296
+ - **UI:** Add sortable columns, quick filter presets and flamegraph search <!-- ffd2e6f -->
297
+
298
+ ## [0.7.0] - 2026-04-05
299
+
300
+ ### Added
301
+
302
+ - **Database:** Add N+1 visual detection and `EXPLAIN ANALYZE` integration <!-- a22902d -->
303
+
304
+ ## [0.6.0] - 2026-04-05
305
+
306
+ ### Added
307
+
308
+ - **MCP:** Reduce token usage with filtering, body file saving and pagination <!-- 834251d -->
309
+
310
+ ## [0.5.0] - 2026-04-04
311
+
312
+ ### Added
313
+
314
+ - **MCP:** Add outbound IDs, a domain filter, datetimes, a latest token, exceptions and copy helpers <!-- 9330545 -->
315
+
316
+ ## [0.4.0] - 2026-04-03
317
+
318
+ ### Added
319
+
320
+ - **Collector:** Add an I18n panel tracking translation lookups per request <!-- 3032a15 -->
321
+
322
+ <!-- excluded:
323
+ b50d1eb pipeline only
324
+ -->
325
+
326
+ ## [0.3.0] - 2026-04-02
327
+
328
+ ### Added
329
+
330
+ - **Collector:** Add a routes panel and enrich the request collector <!-- bdf0e3c -->
331
+
332
+ ## [0.2.0] - 2026-03-29
333
+
334
+ ### Added
335
+
336
+ - **Collector:** Add a Logs panel, capturing `Rails.logger` messages per request <!-- 0e0e7ce -->
337
+ - Publish the gem to RubyGems.org <!-- f292a21 -->
338
+
339
+ <!-- excluded:
340
+ 10c1314 pipeline only, despite the fix: type
341
+ 3f97b1d pipeline only
342
+ a8c2044 pipeline only
343
+ 27cc550 pipeline only
344
+ -->
345
+
346
+ ## [0.1.4] - 2026-03-29
347
+
348
+ ### Added
349
+
350
+ - **Profiler:** Capture the full request and response, and add an MCP history clear <!-- 9922c8a -->
351
+
352
+ ## [0.1.3] - 2026-03-29
353
+
354
+ ### Changed
355
+
356
+ - **Assets:** Migrate Sass `@import` to `@use`, which removes the build deprecation warnings <!-- 1a67e48 -->
357
+
358
+ ## [0.1.2] - 2026-03-25
359
+
360
+ This tag holds nothing but the release commit the pipeline wrote. The interval
361
+ carries no change to the gem, so there is nothing to report for this version.
362
+
363
+ ## [0.1.1] - 2026-03-25
364
+
365
+ ### Added
366
+
367
+ - **HTTP:** Decompress gzip and deflate response bodies before storing them <!-- f71a5c7 -->
368
+ - **Flamegraph:** Add an interactive flame graph tab <!-- 63c4b67 -->
369
+ - **Config:** Add `.well-known` and `favicon.ico` to the default `skip_paths` <!-- 1286447 -->
370
+ - **Storage:** Add an SQLite backend, a blob store and delete/clear APIs <!-- 544015b -->
371
+ - **UI:** Add filters to the profile list action bar and fix the badge colours <!-- 40d4081 -->
372
+ - **HTTP:** Add binary download, inline preview and smart text formatting <!-- b09eab8 -->
373
+ - Rename the HTTP tab, add the outbound HTTP list and extend MCP coverage <!-- 71bc537 -->
374
+ - **Jobs:** Add background job profiling for Sidekiq and ActiveJob <!-- 27b87db -->
375
+ - Add an outbound HTTP request collector <!-- e5f2ac9 -->
376
+ - **MCP:** Migrate to the official Ruby SDK, over HTTP transport <!-- 3fc2d45 -->
377
+ - Implement the dashboard UI, with a tab system and a design system <!-- beb83f7 -->
378
+ - Add the AJAX and dump collectors, and the CORS middleware <!-- 08bad9f -->
379
+ - First implementation of the gem <!-- 360c6fa -->
380
+
381
+ ### Changed
382
+
383
+ - **Docs:** Document installation from the GitLab Package Registry <!-- 527c32b -->
384
+ - **Assets:** Serve every gem asset exclusively under `/_profiler/` <!-- e8ae1ae -->
385
+ - **Config:** Add `manifest.json` to the default `skip_paths` <!-- 350f16c -->
386
+ - **Docs:** Correct the installation instructions in the README and remove the dashboard README <!-- e44c8a2 -->
387
+
388
+ ### Fixed
389
+
390
+ - **Packaging:** Fix the gemspec metadata and file glob, and exclude source assets <!-- 195b609 -->
391
+ - **Packaging:** Switch to the yarn build scripts and update dependencies <!-- b62f2d8 -->
392
+ - **Packaging:** Fix the `http_collector` require, the collectors option override and asset serving in API only applications <!-- 729f20f -->
393
+ - **Packaging:** Exclude `.gem` build artifacts from the file list <!-- 9b97f60 -->
394
+ - **Profiler:** Improve memory tracking and profile deserialisation <!-- a0af47e -->
395
+
396
+ <!-- excluded:
397
+ e27cdae pipeline only
398
+ 02d63c9 pipeline only
399
+ 9f598d9 subject is not conventional, tooling only
400
+ 7d1d823 tests only
401
+ c0d46e6 licence file, not a change to the gem
402
+ -->
@@ -9,24 +9,39 @@ module Profiler
9
9
  ].freeze
10
10
 
11
11
  def initialize(*args, &block)
12
+ # Ruby refuses a Thread with no block, and the wrapper below is a block, so
13
+ # without this the error would never come while a profile is being collected.
14
+ return super if block.nil?
15
+
12
16
  parent_context = PROPAGATED_KEYS.filter_map do |key|
13
17
  val = Thread.current[key]
14
18
  [key, val] unless val.nil?
15
19
  end.to_h
16
20
 
17
- if parent_context.empty?
18
- super
19
- else
20
- super(*args) do
21
- parent_context.each { |k, v| Thread.current[k] = v }
22
- begin
23
- block&.call
24
- ensure
25
- PROPAGATED_KEYS.each { |k| Thread.current[k] = nil }
26
- end
21
+ return super if parent_context.empty?
22
+
23
+ # Thread.new hands its arguments to the block, so the wrapper has to take
24
+ # them and pass them on. Ruby 3.4 depends on it in the stdlib: the Happy
25
+ # Eyeballs hostname resolution of Socket.tcp runs
26
+ # Thread.new(*thread_args) { |*thread_args| resolve_hostname(*thread_args) }
27
+ # and a wrapper that swallows the arguments leaves the name unresolved.
28
+ # The wrapper is a named proc rather than a literal block because only a
29
+ # proc can be given the ruby2_keywords flag, which, together with the one
30
+ # on this method, keeps a trailing keyword hash a keyword hash rather than
31
+ # flattening it into a positional argument.
32
+ wrapper = proc do |*block_args|
33
+ parent_context.each { |k, v| Thread.current[k] = v }
34
+ begin
35
+ block&.call(*block_args)
36
+ ensure
37
+ PROPAGATED_KEYS.each { |k| Thread.current[k] = nil }
27
38
  end
28
39
  end
40
+ wrapper.ruby2_keywords
41
+
42
+ super(*args, &wrapper)
29
43
  end
44
+ ruby2_keywords :initialize
30
45
  end
31
46
  end
32
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Profiler
4
- VERSION = "0.30.4"
4
+ VERSION = "0.30.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.4
4
+ version: 0.30.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Duplessy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-01 00:00:00.000000000 Z
11
+ date: 2026-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -103,6 +103,7 @@ executables:
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
+ - CHANGELOG.md
106
107
  - app/assets/builds/profiler-toolbar.js
107
108
  - app/assets/builds/profiler.css
108
109
  - app/assets/builds/profiler.js
@@ -231,6 +232,7 @@ licenses:
231
232
  metadata:
232
233
  homepage_uri: https://git.duplessy.eu/sebastien/rails-profiler-gem
233
234
  source_code_uri: https://git.duplessy.eu/sebastien/rails-profiler-gem
235
+ changelog_uri: https://git.duplessy.eu/sebastien/rails-profiler-gem/-/blob/master/CHANGELOG.md
234
236
  post_install_message:
235
237
  rdoc_options: []
236
238
  require_paths: