Remove overall speedometer

This commit is contained in:
Marcus Holland-Moritz 2023-08-28 21:39:19 +02:00
parent 4d59bc677f
commit 4fc2705894
2 changed files with 2 additions and 20 deletions

View File

@ -29,7 +29,6 @@
#include <string> #include <string>
#include "dwarfs/logger.h" #include "dwarfs/logger.h"
#include "dwarfs/speedometer.h"
namespace dwarfs { namespace dwarfs {
@ -61,7 +60,5 @@ class console_writer : public stream_logger {
progress_mode const pg_mode_; progress_mode const pg_mode_;
get_term_width_type get_term_width_; get_term_width_type get_term_width_;
display_mode const mode_; display_mode const mode_;
bool writing_{false};
speedometer<uint64_t> read_speed_;
}; };
} // namespace dwarfs } // namespace dwarfs

View File

@ -151,8 +151,7 @@ console_writer::console_writer(std::ostream& os, progress_mode pg_mode,
, frac_(0.0) , frac_(0.0)
, pg_mode_(pg_mode) , pg_mode_(pg_mode)
, get_term_width_(get_term_width) , get_term_width_(get_term_width)
, mode_(mode) , mode_(mode) {}
, read_speed_{std::chrono::seconds(5)} {}
void console_writer::rewind(int next_rewind_lines) { void console_writer::rewind(int next_rewind_lines) {
if (!statebuf_.empty()) { if (!statebuf_.empty()) {
@ -221,17 +220,6 @@ void console_writer::update(const progress& p, bool last) {
switch (mode_) { switch (mode_) {
case NORMAL: case NORMAL:
if (writing_) {
read_speed_.put(p.total_bytes_read.load());
} else {
if (p.total_bytes_read.load() > 0) {
read_speed_.clear();
writing_ = true;
} else {
read_speed_.put(p.similarity_bytes.load());
}
}
if (fancy) { if (fancy) {
oss << terminal_colored(p.status(width.get()), termcolor::BOLD_CYAN, oss << terminal_colored(p.status(width.get()), termcolor::BOLD_CYAN,
log_is_colored()) log_is_colored())
@ -281,10 +269,7 @@ void console_writer::update(const 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(read_speed_.num_per_second()) << "/s" << newline;
// TODO: read speed should be somewhere else
break; break;
case REWRITE: case REWRITE: