Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lfittl/pg_qtop
PostgreSQL query monitor, shows the top queries running
https://github.com/lfittl/pg_qtop
Last synced: 23 days ago
JSON representation
PostgreSQL query monitor, shows the top queries running
- Host: GitHub
- URL: https://github.com/lfittl/pg_qtop
- Owner: lfittl
- License: bsd-3-clause
- Created: 2015-03-26T15:24:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-26T20:09:52.000Z (almost 10 years ago)
- Last Synced: 2024-04-26T17:13:43.783Z (8 months ago)
- Language: Ruby
- Size: 133 KB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pg_qtop
Simple ruby program that shows you queries running using pg_stat_statements.
This is different from the pg_stat_activity view in that it shows you all the queries
that have run since the program was started, not just the queries running at the moment
when you're looking at it.## Installation
```
gem install pg_qtop
```## Usage
```
pg_qtop -d DATABASE -h HOSTNAME -p PORT -U USER
```In order to filter queries on a certain table, specify it with `-t`:
```
pg_qtop -d DATABASE -t TABLE
```You can also filter the kind of statements that are shown with `-s`, e.g.:
```
pg_qtop -d DATABASE -t TABLE -s insert
```## Sample Output
```
AVG | CALLS | HIT RATE | QUERY
--------------------------------------------------------------------------------
50.1ms | 20 | 45.0 | SELECT * FROM databases;
2.1ms | 12 | 97.0 | SELECT * FROM users;
0.0ms | 1 | - | SELECT * FROM query_snapshots;
```The view auto-refreshes every second.
## Authors
- [Lukas Fittl](https://github.com/lfittl)
## License
pg_qtop is licensed under the 3-clause BSD license, see LICENSE file for details.