aboutsummaryrefslogtreecommitdiff
path: root/zen/cmds/dedup.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-12-07 11:36:54 +0100
committerGitHub <[email protected]>2022-12-07 02:36:54 -0800
commitcce239c1d535e047d412ec2ad5ed28ff30d5c955 (patch)
tree59dc18c2c6860d40277f8067e7de6e2e73b003d7 /zen/cmds/dedup.cpp
parentoptimizations (#200) (diff)
downloadarchived-zen-cce239c1d535e047d412ec2ad5ed28ff30d5c955.tar.xz
archived-zen-cce239c1d535e047d412ec2ad5ed28ff30d5c955.zip
Zen cmd fixes (#201)
* updated drop command to support namespaces * fixed hash command error message * fix output of status (and top) command * Use ZEN_CONSOLE for output in zen commands * changelog
Diffstat (limited to 'zen/cmds/dedup.cpp')
-rw-r--r--zen/cmds/dedup.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/zen/cmds/dedup.cpp b/zen/cmds/dedup.cpp
index 7f735571c..2b599c307 100644
--- a/zen/cmds/dedup.cpp
+++ b/zen/cmds/dedup.cpp
@@ -71,22 +71,22 @@ DedupCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
if (!SourceGood)
{
- ZEN_INFO("Source directory '{}' does not support deduplication", m_DedupSource);
+ ZEN_ERROR("Source directory '{}' does not support deduplication", m_DedupSource);
return 0;
}
if (!TargetGood)
{
- ZEN_INFO("Target directory '{}' does not support deduplication", m_DedupTarget);
+ ZEN_ERROR("Target directory '{}' does not support deduplication", m_DedupTarget);
return 0;
}
- ZEN_INFO("Performing dedup operation between {} and {}, size threshold {}",
- m_DedupSource,
- m_DedupTarget,
- zen::NiceBytes(m_SizeThreshold));
+ ZEN_CONSOLE("Performing dedup operation between {} and {}, size threshold {}",
+ m_DedupSource,
+ m_DedupTarget,
+ zen::NiceBytes(m_SizeThreshold));
using DirEntryList_t = std::list<std::filesystem::directory_entry>;
@@ -109,8 +109,8 @@ DedupCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
std::filesystem::recursive_directory_iterator DirEnd;
- ZEN_INFO("Gathering file info from source: '{}'", m_DedupSource);
- ZEN_INFO("Gathering file info from target: '{}'", m_DedupTarget);
+ ZEN_CONSOLE("Gathering file info from source: '{}'", m_DedupSource);
+ ZEN_CONSOLE("Gathering file info from target: '{}'", m_DedupTarget);
{
zen::Stopwatch Timer;
@@ -129,13 +129,13 @@ DedupCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
}
});
- ZEN_INFO("Gathered {} candidates across {} size buckets. Elapsed: {}",
- CandidateCount,
- FileSizeMap.size(),
- zen::NiceTimeSpanMs(Timer.GetElapsedTimeMs()));
+ ZEN_CONSOLE("Gathered {} candidates across {} size buckets. Elapsed: {}",
+ CandidateCount,
+ FileSizeMap.size(),
+ zen::NiceTimeSpanMs(Timer.GetElapsedTimeMs()));
}
- ZEN_INFO("Sorting buckets by size");
+ ZEN_CONSOLE("Sorting buckets by size");
zen::Stopwatch Timer;
@@ -163,7 +163,7 @@ DedupCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
std::sort(begin(SizeLists), end(SizeLists), [](const SizeList& Lhs, const SizeList& Rhs) { return Lhs.Size > Rhs.Size; });
- ZEN_INFO("Bucket summary:");
+ ZEN_CONSOLE("Bucket summary:");
std::vector<size_t> BucketId;
std::vector<size_t> BucketOffsets;
@@ -220,10 +220,10 @@ DedupCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
for (size_t i = 0; i < BucketOffsets.size(); ++i)
{
- ZEN_INFO(" Bucket {} : {}, {} candidates", zen::NiceBytes(BucketId[i]), zen::NiceBytes(BucketSizes[i]), BucketFileCounts[i]);
+ ZEN_CONSOLE(" Bucket {} : {}, {} candidates", zen::NiceBytes(BucketId[i]), zen::NiceBytes(BucketSizes[i]), BucketFileCounts[i]);
}
- ZEN_INFO("Total : {}, {} candidates", zen::NiceBytes(TotalFileSizes), TotalFileCount);
+ ZEN_CONSOLE("Total : {}, {} candidates", zen::NiceBytes(TotalFileSizes), TotalFileCount);
std::string CurrentNice;
@@ -234,7 +234,7 @@ DedupCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
if (CurNice != CurrentNice)
{
CurrentNice = CurNice;
- ZEN_INFO("Now scanning bucket: {}", CurrentNice);
+ ZEN_CONSOLE("Now scanning bucket: {}", CurrentNice);
}
std::unordered_map<zen::BLAKE3, const std::filesystem::directory_entry*, zen::BLAKE3::Hasher> DedupMap;
@@ -299,7 +299,7 @@ DedupCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
Size.DirEntries->clear();
}
- ZEN_INFO("Elapsed: {} Deduped: {}", zen::NiceTimeSpanMs(Timer.GetElapsedTimeMs()), zen::NiceBytes(DupeBytes));
+ ZEN_CONSOLE("Elapsed: {} Deduped: {}", zen::NiceTimeSpanMs(Timer.GetElapsedTimeMs()), zen::NiceBytes(DupeBytes));
return 0;
}