diff options
| author | Dan Engelbrecht <[email protected]> | 2024-08-14 18:19:16 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-08-14 18:19:16 +0200 |
| commit | 0831e5161a3cca3446d488f172e7b8f0be7d38dc (patch) | |
| tree | d252c08b47876fc21f5d040410c87859f8ba4b77 | |
| parent | added `--detach` option to zenserver (#115) (diff) | |
| download | zen-0831e5161a3cca3446d488f172e7b8f0be7d38dc.tar.xz zen-0831e5161a3cca3446d488f172e7b8f0be7d38dc.zip | |
improved logging removing unimportant information (#116)
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zenstore/gc.cpp | 57 |
2 files changed, 34 insertions, 24 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e48b34f38..43acb0abc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - Improvement: Full command line is now logged on startup and added as context information in Sentry reports - Improvement: Retry writing GC state if it fails to handle transient problems - Improvement: If GC operation fails we report an error, after that errors are demoted to warnings until we manage to do a successful GC run. This is to reduce spam on Sentry. +- Improvement: Removed stats for CId entries when doing GCv2 without cleaning up CId references ## 5.5.3 - Feature: New 'workspaces' service which allows a user to share a local folder via zenserver. A workspace can have mulitple workspace shares and they provie an HTTP API that is compatible with the project oplog HTTP API. Workspaces and shares are preserved between runs. Workspaces feature is disabled by default - enable with `--workspaces-enabled` option when launching zenserver. diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp index 8ed74b54b..ec1eb3722 100644 --- a/src/zenstore/gc.cpp +++ b/src/zenstore/gc.cpp @@ -1124,8 +1124,6 @@ GcManager::CollectGarbage(const GcSettings& Settings) } StoreCompactors.clear(); } - - ZEN_INFO("GCV2: Completed in {}", NiceTimeSpanMs(TotalTimer.GetElapsedTimeMs())); } return Sum(Result); @@ -2205,28 +2203,39 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime, GcClock::TimePoint GcStartTime = GcClock::Now(); GcResult Result = m_GcManager.CollectGarbage(Settings); - ZEN_INFO( - "GCV2: Found {} expired items out of {}, deleted {}. " - "Found {} unreferenced Cid entries out of {}, deleted {}. " - "Freed {} on disk and {} of memory in {}. " - "CacheExpireTime: {}, ProjectStoreExpireTime: {}, CollectSmallObjects: {}, " - "IsDeleteMode: {}, SkipCidDelete: {}", - Result.ReferencerStatSum.RemoveExpiredDataStats.FoundCount, - Result.ReferencerStatSum.RemoveExpiredDataStats.CheckedCount, - Result.ReferencerStatSum.RemoveExpiredDataStats.DeletedCount, - - Result.ReferenceStoreStatSum.RemoveUnreferencedDataStats.FoundCount, - Result.ReferenceStoreStatSum.RemoveUnreferencedDataStats.CheckedCount, - Result.ReferenceStoreStatSum.RemoveUnreferencedDataStats.DeletedCount, - - NiceBytes(Result.CompactStoresStatSum.RemovedDisk), - NiceBytes(Result.ReferencerStatSum.RemoveExpiredDataStats.FreedMemory), - NiceTimeSpanMs(Result.ElapsedMS.count()), - Settings.CacheExpireTime, - Settings.ProjectStoreExpireTime, - Settings.CollectSmallObjects, - Settings.IsDeleteMode, - Settings.SkipCidDelete); + ExtendableStringBuilder<256> SB; + if (Result.WasCancelled) + { + SB.Append(fmt::format("Cancelled after {}", NiceTimeSpanMs(Result.ElapsedMS.count()))); + } + else + { + SB.Append( + fmt::format("CacheExpireTime: {}, ProjectStoreExpireTime: {}, CollectSmallObjects: {}, IsDeleteMode: {}, " + "SkipCidDelete: {}\n", + Settings.CacheExpireTime, + Settings.ProjectStoreExpireTime, + Settings.CollectSmallObjects, + Settings.IsDeleteMode, + Settings.SkipCidDelete)); + SB.Append(fmt::format(" Found {} expired items out of {}, deleted {}.\n", + Result.ReferencerStatSum.RemoveExpiredDataStats.FoundCount, + Result.ReferencerStatSum.RemoveExpiredDataStats.CheckedCount, + Result.ReferencerStatSum.RemoveExpiredDataStats.DeletedCount)); + if (!Settings.SkipCidDelete) + { + SB.Append(fmt::format(" Found {} unreferenced Cid entries out of {}, deleted {}.\n", + Result.ReferenceStoreStatSum.RemoveUnreferencedDataStats.FoundCount, + Result.ReferenceStoreStatSum.RemoveUnreferencedDataStats.CheckedCount, + Result.ReferenceStoreStatSum.RemoveUnreferencedDataStats.DeletedCount)); + } + SB.Append(fmt::format(" Freed {} on disk and {} of memory in {}.\n", + NiceBytes(Result.CompactStoresStatSum.RemovedDisk), + NiceBytes(Result.ReferencerStatSum.RemoveExpiredDataStats.FreedMemory), + NiceTimeSpanMs(Result.ElapsedMS.count()))); + } + + ZEN_INFO("GCV2: {}", SB.ToView()); AppendGCLog(GcStartTime, Settings, Result); |