Public Repository

Last pushed: 2 years ago
Short Description
Containerised pghero with cronified capture_query_stats
Full Description

This is a Docker container around the pghero opensource tool (https://github.com/ankane/pghero) version 1.2.2. In addition to the main rails app it has an embedded cron to run the capture_query_stats.

The source for the Docker build is available at https://github.com/jasonumiker/pghero

Note that this historical visibility requires that a table be created in your DB with the following SQL statements:
CREATE TABLE "pghero_query_stats" ("id" serial primary key, "database" text, "query" text, "total_time" float, "calls" bigint, "captured_at" timestamp);
CREATE INDEX "index_pghero_query_stats_on_database_and_captured_at" ON "pghero_query_stats" ("database", "captured_at");

The container must be passed an environment variable for the DB in the following format:
DATABASE_URL=postgres://username:password@dbaddress:5432/dbname

Sample launch command:
docker run -e DATABASE_URL=postgres://test:test@172.22.58.25:5432/test -p 8080:8080 jasonumiker/pghero

Docker Pull Command
Owner
jasonumiker