aboutsummaryrefslogtreecommitdiff
path: root/src/garage/admin.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-13 12:24:30 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-13 12:24:30 +0100
commit9d82196945f751c825621573657cfead992b356b (patch)
tree1482c495ca0761d7c988ce9765e044d266569229 /src/garage/admin.rs
parenta51e8d94c61033783ad8b0dfa2b066e7a59654c2 (diff)
downloadgarage-9d82196945f751c825621573657cfead992b356b.tar.gz
garage-9d82196945f751c825621573657cfead992b356b.zip
cli: new worker info command
Diffstat (limited to 'src/garage/admin.rs')
-rw-r--r--src/garage/admin.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/garage/admin.rs b/src/garage/admin.rs
index da324882..e5bf5601 100644
--- a/src/garage/admin.rs
+++ b/src/garage/admin.rs
@@ -54,6 +54,7 @@ pub enum AdminRpc {
HashMap<usize, garage_util::background::WorkerInfo>,
WorkerListOpt,
),
+ WorkerInfo(usize, garage_util::background::WorkerInfo),
}
impl Rpc for AdminRpc {
@@ -880,6 +881,16 @@ impl AdminRpcHandler {
let workers = self.garage.background.get_worker_info();
Ok(AdminRpc::WorkerList(workers, opt))
}
+ WorkerCmd::Info { tid } => {
+ let info = self
+ .garage
+ .background
+ .get_worker_info()
+ .get(&tid)
+ .ok_or_bad_request(format!("No worker with TID {}", tid))?
+ .clone();
+ Ok(AdminRpc::WorkerInfo(tid, info))
+ }
WorkerCmd::Set { opt } => match opt {
WorkerSetCmd::ScrubTranquility { tranquility } => {
let scrub_command = ScrubWorkerCommand::SetTranquility(tranquility);