rack-mini-profiler 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cacf580297c537f36715f99aa7c7d9e77bce758a122d7b0047767fbdbe44c60c
4
- data.tar.gz: 9ce08b2c74e938104ca61eeace17f659c9177e97117c45a346f3e9b3a6706d5f
3
+ metadata.gz: 569f89edd8e16a6577ec6e22ca4a889026678d288d9282114b8fdeaedc6be2bf
4
+ data.tar.gz: 7ec71935c344ff9113d3b4b9dc70dfaf3430fa30796075391d7d65bc008cb390
5
5
  SHA512:
6
- metadata.gz: a40fa57fd372e7a88a566fc200ae355215fcfe0d397cbdc43322777eeb6c770e245328e6d0df0fa4286af23361979cccb85acae7c783bba90048c03af1f66800
7
- data.tar.gz: 9b40d0e1deeb4a84e2ed147aba8684294d8bd7840b4d087d3b4ddfad700913e02953d496762a265d8ca7f5afb6a916c7133f0da0f24a40cc80952e27de2879c4
6
+ metadata.gz: dcb3c67be45ee1b7dc7516f7ddef1f4f9b6fc1513db927009aac3ef11c504caa6d9b11f3d9a8b28028c7f35f2e6e450cdc0a6b124939d1901679129a758d4499
7
+ data.tar.gz: 28b0c19d557485c1abf1e636bebe911e42c8f3706de174021af6e543c0c52c4a6fa0ecdef39518acb58d18d5284147c4b57c950186a8b630e9bd2e69acbc72c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
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
+
6
+ ## 3.2.1 - 2023-12-07
7
+ - [FIX] memory_profiler was broken due to an undefined local [#597](https://github.com/MiniProfiler/rack-mini-profiler/pull/597)
8
+
3
9
  ## 3.2.0 - 2023-12-06
4
10
  - [BREAKING CHANGE] Ruby version 2.7.0 or later is required.
5
11
  - [FEATURE] All RMP actions can be chosen by including a X-Rack-Mini-Profiler header as well as by query parameter. [#578](https://github.com/MiniProfiler/rack-mini-profiler/pull/578)
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.
@@ -133,7 +133,7 @@ module Rack
133
133
  )
134
134
  end
135
135
 
136
- query_params = Rack::Utils.parse_nested_query(query_string)
136
+ query_params = Rack::Utils.parse_nested_query(env['QUERY_STRING'])
137
137
  options = {
138
138
  ignore_files: query_params['memory_profiler_ignore_files'],
139
139
  allow_files: query_params['memory_profiler_allow_files'],
@@ -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.0'
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.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-12-06 00:00:00.000000000 Z
13
+ date: 2023-12-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack