Skip to content

nordicdyno/pg_stats_viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Alexander Orlovskiy
Jul 12, 2018
e3a816a · Jul 12, 2018

History

41 Commits
Jul 11, 2018
Apr 18, 2014
Jul 11, 2018
Jul 11, 2018
Apr 28, 2018
Apr 21, 2014
Jul 11, 2018
Jul 11, 2018
Jul 11, 2018
Jul 12, 2018
Apr 18, 2014
Aug 31, 2013
Feb 7, 2014
Jul 11, 2018

Repository files navigation

pg_stats_viewer

webview for Postgres pg_stat_statements statisics.

Docker Build [Docker Pulls]

DESCRIPTION

Supports:

  • multiple databases
  • filtering queries by user and database names
  • search by text in queries
  • extra sortable fields like avgtime, rows_per_call and shared_blks_hit_percent
  • sort by pg_stat_statements and extra fields
  • OAuth2 (google, facebook, vk.com)

Used technologies:

HOW TO INSTALL AND RUN

Prepare config:

cat > conf/config.ini
[global]
defaultDB = master

[db master]
name = PG_DB
host = PG_HOST
port = PG_PORT
user = PG_USER
password = PG_PASSWORD
Ctrl+D

PG_DB should contains pg_stat_statements table

PG_USER should be with read permission to relation pg_authid (for user list query), by default it is postgres user

run via docker-compose

run after config creation:

docker-compose pull
docker-compose up

and open http://localhost:9000/

build and run via Docker

make build
make

check (Makefile) for conrete commands

run manually

Prepare Perl tools:

cpan -S App::cpanminus
cpanm -S Carton

Install deps:

cd <app_dir>
carton install

Run with plackup:

carton exec plackup --port 9000 -E deployment

Run with Starman:

carton exec starman --port 9000

TODO

  • vendor external js/css dependencies
  • remove oauth support (just use tool like https://github.com/bitly/oauth2_proxy)
  • don't require permission to pg_authid (abilty to run as unpriveleged postgres user)
  • add instruction how to connect on localhost from docker on Mac
  • add /diag endpoint

About

web based viewer for pg_stat_statement

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published