aboutsummaryrefslogtreecommitdiff
path: root/src/garage/main.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-12 15:40:54 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-12 15:40:54 +0100
commita1442f072ad9427851f49103083582637ddcdbd4 (patch)
tree44f3ba215528ff1242cacfc5d139a564096e6275 /src/garage/main.rs
parentcbe7e1a66a9dceaaeae0467b4eefe51afd5b297c (diff)
downloadgarage-a1442f072ad9427851f49103083582637ddcdbd4.tar.gz
garage-a1442f072ad9427851f49103083582637ddcdbd4.zip
Implement garage stats to get info on node contents
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 {