SimpleApm (Rails Engine)
A lightweight Redis-backed Rails engine for web request performance monitoring and slow request tracing.
SimpleApm records request performance by day:
- The slowest requests, 500 by default.
- The slowest 20 requests for each action.
- Average response time for each action.
- Slow request details and related SQL details, trimming excess records.
- Average and slowest response time, request count, and other metrics in 10-minute intervals, with charts.
- External HTTP request duration during each request.
The web UI supports English and Chinese. English is used by default, and users can switch languages from the top-right corner.
How It Works
SimpleApm records request-level data around Rack and uses Redis for storage and aggregation.
The core data flow is based on Active Support Instrumentation.
Instrumentation events are processed by a long-running worker thread so request handling does not block on metric aggregation.
Memory usage is collected with get_process_mem. In Linux testing, collection takes less than 1 ms.
Screenshots
Usage
Mount the engine in your Rails routes:
# routes.rb
mount SimpleApm::Engine => "/apm"Or run the installer:
rails generate simple_apm:installInstallation
Add this line to your application's Gemfile:
gem "simple_apm"Then run:
bundleContributing
Issues and pull requests are welcome.
License
The gem is available as open source under the terms of the MIT License.





