aboutsummaryrefslogtreecommitdiff
path: root/src/garage/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/garage/main.rs')
-rw-r--r--src/garage/main.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/garage/main.rs b/src/garage/main.rs
index 8757a1bb..0bd70c79 100644
--- a/src/garage/main.rs
+++ b/src/garage/main.rs
@@ -69,6 +69,10 @@ pub enum Command {
/// Start repair of node data
#[structopt(name = "repair")]
Repair(RepairOpt),
+
+ /// Gather node statistics
+ #[structopt(name = "stats")]
+ Stats(StatsOpt),
}
#[derive(StructOpt, Debug)]
@@ -281,6 +285,17 @@ pub enum RepairWhat {
BlockRefs,
}
+#[derive(Serialize, Deserialize, StructOpt, Debug, Clone)]
+pub struct StatsOpt {
+ /// Gather statistics from all nodes
+ #[structopt(short = "a", long = "all-nodes")]
+ pub all_nodes: bool,
+
+ /// Gather detailed statistics (this can be long)
+ #[structopt(short = "d", long = "detailed")]
+ pub detailed: bool,
+}
+
#[tokio::main]
async fn main() {
pretty_env_logger::init();
@@ -332,6 +347,9 @@ async fn main() {
Command::Repair(ro) => {
cmd_admin(admin_rpc_cli, opt.rpc_host, AdminRPC::LaunchRepair(ro)).await
}
+ Command::Stats(so) => {
+ cmd_admin(admin_rpc_cli, opt.rpc_host, AdminRPC::Stats(so)).await
+ }
};
if let Err(e) = resp {