File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66#include " ccf/crypto/sha256_hash.h"
77#include " ledger_filenames.h"
88#include " snapshots/filenames.h"
9+ #include " time_bound_logger.h"
910#include " timer.h"
1011
1112#include < algorithm>
@@ -260,6 +261,9 @@ namespace asynchost
260261 committed_snapshots,
261262 size_t max_retained)
262263 {
264+ TimeBoundLogger log_if_slow (
265+ " Cleaning snapshots" , std::chrono::seconds (1 ));
266+
263267 if (committed_snapshots.size () > max_retained)
264268 {
265269 // committed_snapshots is sorted descending by snapshot index, so the
@@ -292,6 +296,15 @@ namespace asynchost
292296 size_t max_retained,
293297 std::optional<size_t > snapshot_watermark = std::nullopt )
294298 {
299+ TimeBoundLogger log_if_slow (
300+ fmt::format (
301+ " Cleaning ledger chunks from {}, watermark={}" ,
302+ main_dir,
303+ snapshot_watermark.has_value () ?
304+ std::to_string (snapshot_watermark.value ()) :
305+ " none" ),
306+ std::chrono::seconds (1 ));
307+
295308 std::vector<std::pair<size_t , std::filesystem::path>> committed;
296309 try
297310 {
You can’t perform that action at this time.
0 commit comments