mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-08 11:59:48 -04:00
Clean up console writer
This commit is contained in:
parent
f8e7f66b6a
commit
fb8c01cf18
@ -116,6 +116,7 @@ class progress {
|
|||||||
std::atomic<uint64_t> bytes{0};
|
std::atomic<uint64_t> bytes{0};
|
||||||
std::atomic<uint64_t> usec{0};
|
std::atomic<uint64_t> usec{0};
|
||||||
std::atomic<uint64_t> chunk_size{UINT64_C(16) << 20};
|
std::atomic<uint64_t> chunk_size{UINT64_C(16) << 20};
|
||||||
|
std::atomic<uint64_t> bytes_per_sec{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
class scan_updater {
|
class scan_updater {
|
||||||
|
@ -217,6 +217,7 @@ void console_writer::update(progress& p, bool last) {
|
|||||||
sp.chunk_size.store(std::min(
|
sp.chunk_size.store(std::min(
|
||||||
UINT64_C(1) << 25,
|
UINT64_C(1) << 25,
|
||||||
std::max(UINT64_C(1) << 15, std::bit_ceil(bytes_per_second / 32))));
|
std::max(UINT64_C(1) << 15, std::bit_ceil(bytes_per_second / 32))));
|
||||||
|
sp.bytes_per_sec.store(bytes_per_second);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -246,9 +247,15 @@ void console_writer::update(progress& p, bool last) {
|
|||||||
<< newline
|
<< newline
|
||||||
|
|
||||||
<< "original size: " << size_with_unit(p.original_size)
|
<< "original size: " << size_with_unit(p.original_size)
|
||||||
<< ", scanned: " << size_with_unit(p.similarity.bytes)
|
|
||||||
<< ", hashed: " << size_with_unit(p.hash.bytes) << " ("
|
<< ", hashed: " << size_with_unit(p.hash.bytes) << " ("
|
||||||
<< p.hash.scans << " files)" << newline
|
<< p.hash.scans << " files, " << size_with_unit(p.hash.bytes_per_sec)
|
||||||
|
<< "/s)" << newline
|
||||||
|
|
||||||
|
<< "scanned: " << size_with_unit(p.similarity.bytes) << " ("
|
||||||
|
<< p.similarity.scans << " files, "
|
||||||
|
<< size_with_unit(p.similarity.bytes_per_sec) << "/s)"
|
||||||
|
<< ", categorizing: " << size_with_unit(p.categorize.bytes_per_sec)
|
||||||
|
<< "/s" << newline
|
||||||
|
|
||||||
<< "saved by deduplication: "
|
<< "saved by deduplication: "
|
||||||
<< size_with_unit(p.saved_by_deduplication) << " ("
|
<< size_with_unit(p.saved_by_deduplication) << " ("
|
||||||
@ -269,10 +276,7 @@ void console_writer::update(progress& p, bool last) {
|
|||||||
<< newline
|
<< newline
|
||||||
|
|
||||||
<< "compressed filesystem: " << p.blocks_written << " blocks/"
|
<< "compressed filesystem: " << p.blocks_written << " blocks/"
|
||||||
<< size_with_unit(p.compressed_size) << " written"
|
<< size_with_unit(p.compressed_size) << " written" << newline;
|
||||||
<< " [" << size_with_unit(p.hash.chunk_size) << ", "
|
|
||||||
<< size_with_unit(p.similarity.chunk_size) << ", "
|
|
||||||
<< size_with_unit(p.categorize.chunk_size) << "]" << newline;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REWRITE:
|
case REWRITE:
|
||||||
@ -345,7 +349,7 @@ void console_writer::update(progress& p, bool last) {
|
|||||||
|
|
||||||
std::lock_guard lock(log_mutex());
|
std::lock_guard lock(log_mutex());
|
||||||
|
|
||||||
rewind(8 + ctxs.size());
|
rewind(9 + ctxs.size());
|
||||||
|
|
||||||
statebuf_ = oss.str();
|
statebuf_ = oss.str();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user