cli: uniformize output and add some infos

This commit is contained in:
Alex Auvolat
2025-03-12 15:01:39 +01:00
parent d032e2017c
commit e6862c5d3d
20 changed files with 391 additions and 329 deletions
+1 -1
View File
@@ -823,7 +823,7 @@ impl LayoutVersion {
let total_cap_n = self.expect_get_node_capacity(&self.node_id_vec[*n]);
let tags_n = (self.node_role(&self.node_id_vec[*n]).ok_or("<??>"))?.tags_string();
table.push(format!(
" {:?}\t{}\t{} ({} new)\t{}\t{} ({:.1}%)",
" {:?}\t[{}]\t{} ({} new)\t{}\t{} ({:.1}%)",
self.node_id_vec[*n],
tags_n,
stored_partitions[*n],
+9
View File
@@ -124,6 +124,9 @@ pub struct NodeStatus {
/// Hostname of the node
pub hostname: Option<String>,
/// Garage version of the node
pub garage_version: Option<String>,
/// Replication factor configured on the node
pub replication_factor: usize,
@@ -369,6 +372,10 @@ impl System {
&self.layout_manager.rpc_helper
}
pub fn local_status(&self) -> NodeStatus {
self.local_status.read().unwrap().clone()
}
// ---- Administrative operations (directly available and
// also available through RPC) ----
@@ -786,6 +793,7 @@ impl NodeStatus {
.into_string()
.unwrap_or_else(|_| "<invalid utf-8>".to_string()),
),
garage_version: Some(garage_util::version::garage_version().to_string()),
replication_factor: replication_factor.into(),
layout_digest: layout_manager.layout().digest(),
meta_disk_avail: None,
@@ -796,6 +804,7 @@ impl NodeStatus {
fn unknown() -> Self {
NodeStatus {
hostname: None,
garage_version: None,
replication_factor: 0,
layout_digest: Default::default(),
meta_disk_avail: None,