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:
Sample launch command:
docker run -e DATABASE_URL=postgres://test:email@example.com:5432/test -p 8080:8080 jasonumiker/pghero