-
Notifications
You must be signed in to change notification settings - Fork 594
feat(general): add stats to maintenance run - DeleteUnreferencedPacks #4955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(general): add stats to maintenance run - DeleteUnreferencedPacks #4955
Conversation
ce39da6 to
2fb19a5
Compare
julio-lopez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
Requested change in the stats field names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds observability statistics for the DeleteUnreferencedPacks maintenance task, enabling better tracking of blob deletion operations during repository maintenance.
Key Changes:
- Introduces a new
DeleteUnreferencedPacksStatsstruct to capture unreferenced, deleted, and retained blob counts and sizes - Updates
DeleteUnreferencedBlobsto return statistics instead of just a count - Adds tracking for retained blobs (those preserved due to cutoff time, minimum age, or active session constraints)
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
repo/maintenancestats/stats_delete_unreferenced_packs.go |
Defines the new stats structure with JSON serialization and summary methods |
repo/maintenancestats/builder_test.go |
Adds test cases for serializing/deserializing the new stats type |
repo/maintenancestats/builder.go |
Registers the new stats kind in the builder factory |
repo/maintenance/maintenance_run.go |
Simplifies task runners to directly return stats from DeleteUnreferencedBlobs |
repo/maintenance/blob_gc.go |
Implements stats collection including retained blob tracking and returns structured stats |
cli/command_blob_gc.go |
Updates CLI command to use the new stats structure |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4955 +/- ##
==========================================
+ Coverage 75.86% 77.99% +2.13%
==========================================
Files 470 544 +74
Lines 37301 31353 -5948
==========================================
- Hits 28299 24455 -3844
+ Misses 7071 4851 -2220
- Partials 1931 2047 +116 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2fb19a5 to
84b7e75
Compare
84b7e75 to
18b935f
Compare
|
Thanks! |
Maintenance is critical for healthy of the repository.
On the other hand, Maintenance is complex, because it runs multiple sub tasks each may generate different results according to the maintenance policy. The results may include deleting/combining/adding data/metadata to the repository.
It is worthy to add more observability for these tasks for below reasons:
There will be a serial of PRs to add observability info for each sub task.
The current PR add the stats info for DeleteUnreferencedPacks sub task.