From d2044694fff4b6b11cf57e055356f404347b7dad Mon Sep 17 00:00:00 2001 From: Robert Escriva Date: Mon, 2 Dec 2024 10:41:01 -0800 Subject: [PATCH] Make start print the uuid of started task. --- rust/load/src/bin/chroma-load-start.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rust/load/src/bin/chroma-load-start.rs b/rust/load/src/bin/chroma-load-start.rs index cf787552a746..b06694719c15 100644 --- a/rust/load/src/bin/chroma-load-start.rs +++ b/rust/load/src/bin/chroma-load-start.rs @@ -34,13 +34,27 @@ async fn main() { }; match client .post(format!("{}/start", args.host)) + .header(reqwest::header::ACCEPT, "application/json") .json(&req) .send() .await { Ok(resp) => { if resp.status().is_success() { - println!("Started workload on {}", args.host); + let uuid = match resp.text().await { + Ok(uuid) => uuid, + Err(err) => { + eprintln!("Failed to start workload on {}: {}", args.host, err); + return; + } + }; + println!( + "Started workload on {}:\n{}", + args.host, + // SAFETY(rescrv): serde_json::to_string_pretty should always convert to JSON + // when it just parses as JSON. + uuid, + ); } else { eprintln!( "Failed to start workload on {}: {}",