rack-mini-profiler 3.2.1 → 3.3.0

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: 5de3dd35de6bde41ce48f018dfacf85384d2ef7bfbaa8c224f066c633bcdc3a1
4
- data.tar.gz: f733fd6d06cd072e42a2785c9303384c7e2dba96040f6c3a36357c29a4e4fff6
3
+ metadata.gz: 569f89edd8e16a6577ec6e22ca4a889026678d288d9282114b8fdeaedc6be2bf
4
+ data.tar.gz: 7ec71935c344ff9113d3b4b9dc70dfaf3430fa30796075391d7d65bc008cb390
5
5
  SHA512:
6
- metadata.gz: 703241aecdf35b03431554b17351b235423aaa64a4261c3f21a6e6daf98881c3e04d4ed80fe609dc5fcacc3db51837ae44c423cb4c2565d506f124ab7d4a85d6
7
- data.tar.gz: 54128f96e4b6f423ed427b3715498151aed37eff65948268527700ad75cace6744a696dd87379ab7919496b501f6621d8bcb545c48e073e3b2261c02b3e3835a
6
+ metadata.gz: dcb3c67be45ee1b7dc7516f7ddef1f4f9b6fc1513db927009aac3ef11c504caa6d9b11f3d9a8b28028c7f35f2e6e450cdc0a6b124939d1901679129a758d4499
7
+ data.tar.gz: 28b0c19d557485c1abf1e636bebe911e42c8f3706de174021af6e543c0c52c4a6fa0ecdef39518acb58d18d5284147c4b57c950186a8b630e9bd2e69acbc72c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.3.0 - 2023-12-07
4
+ - [FEATURE] Use `?pp=flamegraph?ignore_gc=true` or `config.flamegraph_ignore_gc` to ignore gc in flamegraphs. [#599](https://github.com/MiniProfiler/rack-mini-profiler/pull/599)
5
+
3
6
  ## 3.2.1 - 2023-12-07
4
7
  - [FIX] memory_profiler was broken due to an undefined local [#597](https://github.com/MiniProfiler/rack-mini-profiler/pull/597)
5
8
 
data/README.md CHANGED
@@ -431,6 +431,7 @@ start_hidden | `false`
431
431
  backtrace_threshold_ms | `0` | Minimum SQL query elapsed time before a backtrace is recorded.
432
432
  flamegraph_sample_rate | `0.5` | How often to capture stack traces for flamegraphs in milliseconds.
433
433
  flamegraph_mode | `:wall` | The [StackProf mode](https://github.com/tmm1/stackprof#all-options) to pass to `StackProf.run`.
434
+ flamegraph_ignore_gc | `false` | Whether to ignore garbage collection frames in flamegraphs.
434
435
  base_url_path | `'/mini-profiler-resources/'` | Path for assets; added as a prefix when naming assets and sought when responding to requests.
435
436
  cookie_path | `'/'` | Set-Cookie header path for profile cookie
436
437
  collapse_results | `true` | If multiple timing results exist in a single page, collapse them till clicked.
@@ -30,6 +30,7 @@ module Rack
30
30
  @backtrace_threshold_ms = 0
31
31
  @flamegraph_sample_rate = 0.5
32
32
  @flamegraph_mode = :wall
33
+ @flamegraph_ignore_gc = false
33
34
  @storage_failure = Proc.new do |exception|
34
35
  if @logger
35
36
  @logger.warn("MiniProfiler storage failure: #{exception.message}")
@@ -76,7 +77,7 @@ module Rack
76
77
  :storage_options, :user_provider, :enable_advanced_debugging_tools,
77
78
  :skip_sql_param_names, :suppress_encoding, :max_sql_param_length,
78
79
  :content_security_policy_nonce, :enable_hotwire_turbo_drive_support,
79
- :flamegraph_mode, :profile_parameter
80
+ :flamegraph_mode, :flamegraph_ignore_gc, :profile_parameter
80
81
 
81
82
  # ui accessors
82
83
  attr_accessor :collapse_results, :max_traces_to_show, :position,
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Rack
4
4
  class MiniProfiler
5
- VERSION = '3.2.1'
5
+ VERSION = '3.3.0'
6
6
  SOURCE_CODE_URI = 'https://github.com/MiniProfiler/rack-mini-profiler'
7
7
  end
8
8
  end
@@ -161,6 +161,7 @@ module Rack
161
161
  #{make_link "async-flamegraph", env} : store flamegraph data for this page and all its AJAX requests. Flamegraph links will be available in the mini-profiler UI (requires the stackprof gem).
162
162
  #{make_link "flamegraph&flamegraph_sample_rate=1", env}: creates a flamegraph with the specified sample rate (in ms). Overrides value set in config
163
163
  #{make_link "flamegraph&flamegraph_mode=cpu", env}: creates a flamegraph with the specified mode (one of cpu, wall, object, or custom). Overrides value set in config
164
+ #{make_link "flamegraph&flamegraph_ignore_gc=true", env}: ignore garbage collection frames in flamegraphs. Overrides value set in config
164
165
  #{make_link "flamegraph_embed", env} : a graph representing sampled activity (requires the stackprof gem), embedded resources for use on an intranet.
165
166
  #{make_link "trace-exceptions", env} : will return all the spots where your application raises exceptions
166
167
  #{make_link "analyze-memory", env} : will perform basic memory analysis of heap
data/lib/mini_profiler.rb CHANGED
@@ -302,11 +302,20 @@ module Rack
302
302
  mode = config.flamegraph_mode
303
303
  end
304
304
 
305
+ ignore_gc_match_data = action_parameters(env)['flamegraph_ignore_gc']
306
+
307
+ if ignore_gc_match_data
308
+ ignore_gc = ignore_gc_match_data == 'true'
309
+ else
310
+ ignore_gc = config.flamegraph_ignore_gc
311
+ end
312
+
305
313
  flamegraph = StackProf.run(
306
314
  mode: mode,
307
315
  raw: true,
308
316
  aggregate: false,
309
- interval: (sample_rate * 1000).to_i
317
+ interval: (sample_rate * 1000).to_i,
318
+ ignore_gc: ignore_gc
310
319
  ) do
311
320
  status, headers, body = @app.call(env)
312
321
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-mini-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron