Middleware that displays a speed badge for every HTML page in Ruby Rack apps, with optional flamegraphs and memory profiling.
rack-mini-profiler is a performance profiling middleware for Ruby Rack applications. It injects a small speed badge into HTML pages that displays detailed timing information for each request, including database queries, rendering time, and overall duration. It helps developers quickly identify performance bottlenecks in both development and production environments.
Ruby developers building web applications with Rack-based frameworks like Rails, Sinatra, or Hanami who need to monitor and optimize application performance.
It provides real-time, in-browser performance insights without requiring external tools, supports advanced profiling like flamegraphs and memory analysis, and is designed to be safe for production use with configurable access controls.
Profiler for your development and production Ruby rack apps.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Injects a speed badge directly into HTML pages, showing request duration, SQL query times, and more without external tools, as demonstrated in the screenshot and features list.
Supports flamegraphs via the stackprof gem and memory profiling with memory_profiler, allowing deep dives into call-stacks and allocations for pinpointing bottlenecks.
Includes configurable access controls via Rack::MiniProfiler.authorize_request and storage backends like Redis, making it suitable for use in live environments with security considerations.
Works with Rails, Sinatra, Hanami, and plain Rack apps, as shown in installation examples, ensuring broad compatibility across Ruby web frameworks.
Frequently causes 'stack level too deep' errors with other patches (e.g., Net::HTTP, pg, peek-mysql2), requiring awkward workarounds like specific require arrays in the Gemfile, as detailed in the troubleshooting sections.
In production with multiple servers, it mandates external storage (Redis or Memcache) for proper functionality, adding infrastructure dependency and configuration overhead beyond basic file or memory stores.
For single-page applications, requires manual script injection and calls to window.MiniProfiler.pageTransition(), which is cumbersome and error-prone compared to seamless framework integrations.