File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ struct Args {
24
24
#[ arg( long) ]
25
25
database : String ,
26
26
#[ arg( long) ]
27
- api_key : String ,
28
- #[ arg( long) ]
29
27
constant_throughput : Option < f64 > ,
30
28
#[ arg( long) ]
31
29
sinusoid_throughput : Option < String > ,
@@ -90,6 +88,10 @@ impl Args {
90
88
#[ tokio:: main]
91
89
async fn main ( ) {
92
90
let args = Args :: parse ( ) ;
91
+
92
+ // Read API key from environment variable.
93
+ let api_key = std:: env:: var ( "CHROMA_API_KEY" ) . expect ( "CHROMA_API_KEY is not set" ) ;
94
+
93
95
let client = reqwest:: Client :: new ( ) ;
94
96
let throughput = args. throughput ( ) ;
95
97
let mut workload = Workload :: ByName ( args. workload ) ;
@@ -108,7 +110,7 @@ async fn main() {
108
110
data_set : args. data_set ,
109
111
connection : Connection {
110
112
url : args. url ,
111
- api_key : args . api_key ,
113
+ api_key,
112
114
database : args. database ,
113
115
} ,
114
116
throughput,
Original file line number Diff line number Diff line change @@ -1026,8 +1026,16 @@ pub struct LoadHarness {
1026
1026
1027
1027
impl LoadHarness {
1028
1028
/// The status of the load harness.
1029
+ /// This returns the list of running workloads with secrets redacted.
1029
1030
pub fn status ( & self ) -> Vec < RunningWorkload > {
1030
- self . running . clone ( )
1031
+ self . running
1032
+ . iter ( )
1033
+ . map ( |w| {
1034
+ let mut w = w. clone ( ) ;
1035
+ w. connection . api_key = "REDACTED" . to_string ( ) ;
1036
+ w
1037
+ } )
1038
+ . collect ( )
1031
1039
}
1032
1040
1033
1041
/// Start a workload on the load harness.
You can’t perform that action at this time.
0 commit comments