aboutsummaryrefslogtreecommitdiff
path: root/zenstore/gc.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-12-05 19:04:39 +0100
committerPer Larsson <[email protected]>2021-12-05 19:04:39 +0100
commit69c33063aaa85abf153bea036c58937067a80cd5 (patch)
tree6c13f9c8095e727213cf754d274694af05afb3ce /zenstore/gc.cpp
parentAdded simple GC interval scheduling. (diff)
downloadzen-69c33063aaa85abf153bea036c58937067a80cd5.tar.xz
zen-69c33063aaa85abf153bea036c58937067a80cd5.zip
Check available disk space before GC.
Diffstat (limited to 'zenstore/gc.cpp')
-rw-r--r--zenstore/gc.cpp12
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));
}
}
}