Module: HeapScope::Noise
- Defined in:
- lib/heapscope/noise.rb
Overview
Known framework / VM noise filters. Affects findings, not raw snapshot data.
Constant Summary collapse
- DEFAULT_PATTERNS =
[ /^RubyVM/, /^Zeitwerk/, /^Bootsnap/, /^ActiveSupport::Dependencies/, /^Module$/, /^Class$/, /^HeapScope::/ ].freeze
- FRAMEWORK_HINTS =
Extra framework hints used by Suggest (never auto-applied to config).
[ /^ActiveSupport::/, /^ActiveRecord::ConnectionAdapters/, /^ActionDispatch::/, /^ActionController::/, /^ActionView::/, /^Rack::/, /^Sidekiq::/, /^Concurrent::/ ].freeze
Class Method Summary collapse
- .apply_defaults! ⇒ Object
- .default_patterns ⇒ Object
- .noisy?(name, patterns: HeapScope.config.ignore_patterns) ⇒ Boolean
- .suggestion_patterns ⇒ Object
Class Method Details
.apply_defaults! ⇒ Object
42 43 44 45 46 |
# File 'lib/heapscope/noise.rb', line 42 def apply_defaults! DEFAULT_PATTERNS.each do |pattern| HeapScope.config.ignore_patterns << pattern unless HeapScope.config.ignore_patterns.include?(pattern) end end |
.default_patterns ⇒ Object
30 31 32 |
# File 'lib/heapscope/noise.rb', line 30 def default_patterns DEFAULT_PATTERNS.dup end |
.noisy?(name, patterns: HeapScope.config.ignore_patterns) ⇒ Boolean
38 39 40 |
# File 'lib/heapscope/noise.rb', line 38 def noisy?(name, patterns: HeapScope.config.ignore_patterns) patterns.any? { |p| name.to_s.match?(p) } end |
.suggestion_patterns ⇒ Object
34 35 36 |
# File 'lib/heapscope/noise.rb', line 34 def suggestion_patterns DEFAULT_PATTERNS + FRAMEWORK_HINTS end |