aboutsummaryrefslogtreecommitdiff
path: root/src/garage/cli/util.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-10 11:27:58 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-10 11:27:58 +0200
commit180e7fef0a1bdd396865eff92ec6f1d7f0e7511e (patch)
tree46c5c358b12e2c86d56ad92a4a51640c428d93dd /src/garage/cli/util.rs
parentc054de43dd3ccbf6a884f73a474b423bbab41d08 (diff)
downloadgarage-180e7fef0a1bdd396865eff92ec6f1d7f0e7511e.tar.gz
garage-180e7fef0a1bdd396865eff92ec6f1d7f0e7511e.zip
Actually distribute counters over nodes
Diffstat (limited to 'src/garage/cli/util.rs')
-rw-r--r--src/garage/cli/util.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/garage/cli/util.rs b/src/garage/cli/util.rs
index 28a34daa..329e8a3e 100644
--- a/src/garage/cli/util.rs
+++ b/src/garage/cli/util.rs
@@ -9,11 +9,11 @@ use garage_model::bucket_table::*;
use garage_model::key_table::*;
use garage_model::s3::object_table::{BYTES, OBJECTS, UNFINISHED_UPLOADS};
-pub fn print_bucket_list(buckets: Vec<Bucket>, counters: HashMap<Uuid, HashMap<String, i64>>) {
+pub fn print_bucket_list(bl: Vec<Bucket>) {
println!("List of buckets:");
let mut table = vec![];
- for bucket in buckets {
+ for bucket in bl {
let aliases = bucket
.aliases()
.iter()
@@ -31,18 +31,11 @@ pub fn print_bucket_list(buckets: Vec<Bucket>, counters: HashMap<Uuid, HashMap<S
s => format!("[{} local aliases]", s.len()),
};
- let empty_counters = HashMap::new();
- let cnt = counters.get(&bucket.id).unwrap_or(&empty_counters);
-
table.push(format!(
- "\t{}\t{}\t{}\t{}\t{}\t{}",
+ "\t{}\t{}\t{}",
aliases.join(","),
local_aliases_n,
hex::encode(bucket.id),
- bytesize::ByteSize::b(cnt.get(BYTES).cloned().unwrap_or_default() as u64)
- .to_string_as(true),
- cnt.get(OBJECTS).cloned().unwrap_or_default(),
- cnt.get(UNFINISHED_UPLOADS).cloned().unwrap_or_default(),
));
}
format_table(table);