darold / pgbadger

A fast PostgreSQL Log Analyzer
http://pgbadger.darold.net/
PostgreSQL License
3.55k stars 352 forks source link

documentation improvement? #708

Closed wibrt closed 2 years ago

wibrt commented 2 years ago

The binary format on https://pgbadger.darold.net/documentation.html describes the following steps:

pgbadger --last-parsed .pgbadger_last_state_file -o sunday/hourX.bin /var/log/pgsql/postgresql-Sun.log pgbadger sunday/*.bin

so generating bin files every hour of a daily log (the same should apply to a weekly log?), and building the html report based on those bin files, in my experience this adds already processed data to the report, see #569 (can anyone confirm this?)

but if you only take the last generated binary file (or just 1 bin file), then the results seem to be correct, so i guess

pgbadger sunday/*.bin

should be replaced with

pgbadger sunday/latest.bin

where latest.bin is the last generated bin file (or another as needed for the report), but not processing several *.bin (as they are probably overlapping, being build from the same log file)

darold commented 2 years ago

If you want to use the --last-parsed option the file must exist or you must use the incremental mode -I so that pdBadger will create it after the run, then the next time you run the same command it will not take in account the old binary data. I will review the documentation to see if there is something wrong in the explanation.

darold commented 2 years ago

Hum, no I'm not correct to respect the use case of the documentation -I should not be specified and the last parsed file must be created. There must be a bug here, looking deeper.

darold commented 2 years ago

No documentation change but commit a8ca1eb might fix the original problem reported in #569