run-queue: Automatically prune the test results database #7318
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If test-results.db gets too big (> 25 MB), prune it to the last 14 days. We are occasionally doing this manually, but not often enough -- it routinely grows to > 100 MB, which makes the weather report take ages to load.
The database shrinks to about 15 MB after being freshly pruned, so 25 MB gives enough margin to avoid running the pruning too often (as it's a bit expensive).
I tuned this with getting https://ci-weather-cockpit.apps.ocp.cloud.ci.centos.org/test-results.db (currently 170 MB). Running
./prometheus-stats --db /tmp/test-results.db --prune 14
shrinks it to 15 MB.I just made a backup at https://ci-weather-cockpit.apps.ocp.cloud.ci.centos.org/test-results.db.20250117 in case anything goes wrong.