Get insights of your PostgreSQL database with PgHero

PgHero is a ruby gem that gives you insights of your PostgreSQL database.

Out of the box it provides info about stuff like cache hit rate, which queries are too slow, which tables need indexes, and more. Here's how it looks on a production app:

(Yeah, I have to add an index there I know :P)

To add it to your app: add this line to your  Gemfile:
gem 'pghero'
And add this to config/routes.rb to mount the dashboard:
mount PgHero::Engine, at: "pghero"

You'll also want to secure the access to the dashboard if you mount it as part of your public-facing app; we didn't have to as it is in our admin section.

There's also the option to check the insights programmatically, run it via SQL without the web interface, run it as a standalone app, get system stats like CPU usage… check their readme for the good stuff.

Happy optimizing!