MiniProfiler / rack-mini-profiler

Profiler for your development and production Ruby rack apps.
MIT License
3.7k stars 402 forks source link

Feature request: Ability to pass ignore_gc to StackProf.run #514

Closed danny-pflughoeft closed 9 months ago

danny-pflughoeft commented 2 years ago

In memory-heavy apps, the GC frames make the flamegraph basically unusable

Screen Shot 2021-12-16 at 5 27 05 PM

StackProf has an option to fix this: ignore_gc. However it's not exposed by rack-mini-profiler

takaebato commented 1 year ago

As a workaround, I add this code to a file in config/initializers. So far it's working fine.

module Rack
  class MiniProfiler
    module StackProf
      def self.run(mode:, raw:, aggregate:, interval:)
        ::StackProf.run(
          mode: mode,
          raw: raw,
          aggregate: aggregate,
          interval: interval,
          ignore_gc: true
        ) do
          yield
        end
      end
    end
  end
end