diff options
| author | Per Larsson <[email protected]> | 2021-12-05 19:04:39 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-12-05 19:04:39 +0100 |
| commit | 69c33063aaa85abf153bea036c58937067a80cd5 (patch) | |
| tree | 6c13f9c8095e727213cf754d274694af05afb3ce /zenstore/gc.cpp | |
| parent | Added simple GC interval scheduling. (diff) | |
| download | zen-69c33063aaa85abf153bea036c58937067a80cd5.tar.xz zen-69c33063aaa85abf153bea036c58937067a80cd5.zip | |
Check available disk space before GC.
Diffstat (limited to 'zenstore/gc.cpp')
| -rw-r--r-- | zenstore/gc.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp index 7ab2045b5..b18a577bf 100644 --- a/zenstore/gc.cpp +++ b/zenstore/gc.cpp @@ -318,7 +318,10 @@ GcScheduler::SchedulerThread() if (m_Config.Enabled) { Stopwatch Timer; - ZEN_INFO("garbage collection STARTING"); + + DiskSpace Space; + DiskSpaceInfo(m_Config.RootDirectory, Space); + ZEN_INFO("garbage collection STARTING, disk space {}/{} (free/total)", NiceBytes(Space.Free), NiceBytes(Space.Total)); GcContext GcCtx; GcCtx.SetDeletionMode(true); @@ -335,7 +338,12 @@ GcScheduler::SchedulerThread() SaveCompactBinaryObject(m_Config.RootDirectory / "gc_state", SchedulderState.Save()); } - ZEN_INFO("garbage collection DONE after {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); + DiskSpaceInfo(m_Config.RootDirectory, Space); + + ZEN_INFO("garbage collection DONE after {}, disk space {}/{} (free/total)", + NiceTimeSpanMs(Timer.GetElapsedTimeMs()), + NiceBytes(Space.Free), + NiceBytes(Space.Total)); } } } |