It has a long time since I met ActiveSupport::Notifications for the first time. Since then, I haven’t stopping thinking about how cool would be to create a simple tool to give me information about my application performance and where it’s spending time, in a way I could check in real-time whether I have to optimize something or ignore possible issues by now.
With this idea in mind, I decided to have some fun and create Healthyr. It is composed by two parts: the ruby gem and the monitor.
The Rails application uses the gem to collect and report data, containing information about database, view and controllers. Once the monitor receives this data, it displays it in ways you can easily detect potential problems, like: Interaction of database/view/controllers (charts) and Top worse results (tables).
You can see which query/view/controller is spending more time. In case of controllers, you also have a more detailed information including how much time was spent on database and rendering the view template.
I have used it in my personal projects and I have found it quite useful. One thing that I am currently doing is using it together with TDD. I can instately get feedback from my queries, views and controller actions in the moment I am running my test suite. It has helped not just with finding bottlenecks and performance issues, but also with information about tests using database where it isn't necessary at all.
Both the gem and the monitor are simple (and small) at the moment. It still has lots of things to polish/add, but I decided to release it early, once it's already helping me and I believe it could help others. I will keep adding features/fixes accordingly to my personal needs and I also would appreciate if more people decide to start contributing. You can find more details and its code at https://github.com/elvio/healthyr.
If you give it a try, I would appreciate if you send some feedback to [email protected].
By joining this free, 5-lesson course, you'll receive personalized & actionable lessons that cover: