diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-23 17:05:11 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-23 17:05:11 +0200 |
commit | 59b43914d4a9ae9a50ae79fee61b1a46bff941f9 (patch) | |
tree | 5ca8cdeb754b47a855d142891e41214b77e88c52 /src/garage/cli | |
parent | f82cf164f5ab525560415355503c04315901a739 (diff) | |
download | garage-59b43914d4a9ae9a50ae79fee61b1a46bff941f9.tar.gz garage-59b43914d4a9ae9a50ae79fee61b1a46bff941f9.zip |
(to test) error reporting and throttling at higher layer
Diffstat (limited to 'src/garage/cli')
-rw-r--r-- | src/garage/cli/util.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/garage/cli/util.rs b/src/garage/cli/util.rs index 81361864..ddb353f9 100644 --- a/src/garage/cli/util.rs +++ b/src/garage/cli/util.rs @@ -242,7 +242,7 @@ pub fn print_worker_info(wi: HashMap<usize, WorkerInfo>) { wi.sort_by_key(|(tid, info)| { ( match info.status { - WorkerStatus::Busy => 0, + WorkerStatus::Busy | WorkerStatus::Throttled(_) => 0, WorkerStatus::Idle => 1, WorkerStatus::Done => 2, }, @@ -256,6 +256,20 @@ pub fn print_worker_info(wi: HashMap<usize, WorkerInfo>) { if let Some(i) = &info.info { table.push(format!("\t\t{}", i)); } + if info.consecutive_errors > 0 { + table.push(format!( + "\t\t{} CONSECUTIVE ERRORS ({} total), last: {}", + info.consecutive_errors, + info.errors, + info.last_error.as_deref().unwrap_or("(?)") + )); + } else if info.errors > 0 { + table.push(format!( + "\t\t{} errors, last: {}", + info.errors, + info.last_error.as_deref().unwrap_or("(?)") + )); + } } format_table(table); } |