mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-24 11:36:31 +00:00
cli: uniformize output and add some infos
This commit is contained in:
@@ -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],
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user