diff --git a/rust/load/src/bin/chroma-load-status.rs b/rust/load/src/bin/chroma-load-status.rs new file mode 100644 index 00000000000..5e874a1e43d --- /dev/null +++ b/rust/load/src/bin/chroma-load-status.rs @@ -0,0 +1,35 @@ +//! Inspect chroma-load + +use clap::Parser; + +#[derive(Parser, Debug)] +struct Args { + #[arg(long)] + host: String, +} + +#[tokio::main] +async fn main() { + let args = Args::parse(); + let client = reqwest::Client::new(); + match client + .get(&args.host) + .header(reqwest::header::ACCEPT, "application/json") + .send() + .await + { + Ok(resp) => { + if resp.status().is_success() { + let status = resp.json::().await; + println!("{:#?}", status); + } else { + eprintln!( + "Failed to get workload status on {}: {}", + args.host, + resp.status() + ); + } + } + Err(e) => eprintln!("Failed to get workload status on {}: {}", args.host, e), + } +} diff --git a/rust/load/src/rest.rs b/rust/load/src/rest.rs index 2d2db9c73ea..966442c98d7 100644 --- a/rust/load/src/rest.rs +++ b/rust/load/src/rest.rs @@ -23,7 +23,7 @@ impl From<&dyn crate::DataSet> for Description { pub struct Status { pub running: Vec, pub data_sets: Vec, - pub workloads: Vec, + pub workloads: Vec, } #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]