Log pg statistics at the end of a test run
What does this MR do and why?
Resolves #709 (closed)
At the completion of the E2E tests in the master pipelines, the test environment, including the postgres db is destroyed. In gitlab#396649 (closed) the performance of GitLab was severely impacted due to an unusual amount of database rows being written to pg. This was difficult to debug as there were no pg statistics logged.
This MR logs postgres statistics to a pg_stats.log
file and saves them as an artifact of the test job. It captures:
- Live and dead row counts after the test run
- Cumulative user table statistics after the test run
How to set up and validate locally
Here is a GitLab MR using using this branch of gitlab-qa
.
- Example pipeline: https://gitlab.com/gitlab-org/gitlab/-/pipelines/922448556
- Example job: https://gitlab.com/gitlab-org/gitlab/-/jobs/4603286927#L2919
From this job there is a pg_stats.log
artifact (direct link) which has the output.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.