Over a million developers have joined DZone.

PgHero: Easy Insights Into Your PostgreSQL Database

· Java Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

If you're working with PostgreSQL and want to get a better a sense of what's going on under the hood in your database, here's something cool: PgHero, created by Andrew Kane on GitHub, offers a variety of insights into running queries, used and unused resources, and things like that. The GitHub page lists the following commands:

PgHero.running_queries
PgHero.long_running_queries
PgHero.index_usage
PgHero.missing_indexes
PgHero.unused_indexes
PgHero.unused_tables
PgHero.database_size
PgHero.relation_sizes
PgHero.index_hit_rate
PgHero.table_hit_rate

# kill queries
PgHero.kill(pid)
PgHero.kill_all

And the end result is something like this:

(Source: PgHero on GitHub)

You'll need PostgreSQL 9.2 or better to run PgHero, and it's definitely still a work in progress - there's a TODO section on the GitHub page, after all - but still worth checking out.


The Java Zone is brought to you by Stormpath—a complete, pre-built User Management API. Want to learn how to use JWTs to protect microservices from CSRF and more? Check out this on-demand webinar with our Java Developer Evangelist, Micah Silverman.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}