Pgsi
From Bucardo
Contents |
pgsi
pgsi is the Postgres System Impact report, a script that analyzed Postgres log files and reports on which queries have the highest overall impact on the server. The impact is computed by looking at not only how long each query takes to complete, but how many times it is run, and the time period between subsequent runs. The report show the queries with the highest system impacts, grouped by the type of query (SELECT, UPDATE, etc.)
Download
The latest version of pgsi, 1.2.0, can be downloaded at:
Basic Usage
To use pgsi, you must run it against a Postgres logfile that has full logging enabled. Then run:
perl pgsi.pl --file=logfile > pgsi.html
Command Line Options
- --version
- Returns the version number
- --verbose
- Increases the level of verbosity
- --help
- Gives some basic help
- --file=x
- The log file to parse. If not given, will read stdin.
- --format=X
- Indicates the format of the output file. Current options are html and mediawiki
- --mode=X
- Indicates the log file mode. Current options are pid and syslog
- --color
- Adds syntax highlighting to the queries in html format. On by default, can be turned off with --no-color
Development
Everyone is encouraged to look over and make improvements to the code. The latest development version can be obtained by running:
git clone git://bucardo.org/pgsi.git
There is also a GitHub mirror for easy patch contribution by the general public.