diff --git a/antithesis-tests/stress/singleton_driver_stress.sh b/antithesis-tests/stress/singleton_driver_stress.sh index 06f27223f..ddd2ec7e4 100755 --- a/antithesis-tests/stress/singleton_driver_stress.sh +++ b/antithesis-tests/stress/singleton_driver_stress.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -/bin/limbo_stress \ No newline at end of file +/bin/limbo_stress --silent diff --git a/stress/main.rs b/stress/main.rs index b342d66d2..527a31cba 100644 --- a/stress/main.rs +++ b/stress/main.rs @@ -322,7 +322,16 @@ fn generate_plan(opts: &Opts) -> Result Result<(), Box> { } let plan = if opts.load_log { + println!("Loading plan from log file..."); read_plan_from_log_file(&mut opts)? } else { + println!("Generating plan..."); generate_plan(&opts)? }; @@ -428,7 +439,9 @@ async fn main() -> Result<(), Box> { // Apply each DDL statement individually for stmt in &plan.ddl_statements { - println!("executing ddl {}", stmt); + if opts.verbose { + println!("executing ddl {}", stmt); + } if let Err(e) = conn.execute(stmt, ()).await { match e { limbo::Error::SqlExecutionFailure(e) => { @@ -448,9 +461,22 @@ async fn main() -> Result<(), Box> { let handle = tokio::spawn(async move { let conn = db.connect()?; + println!("\rExecuting queries..."); for query_index in 0..nr_iterations { let sql = &plan.queries_per_thread[thread][query_index]; - println!("executing: {}", sql); + if !opts.silent { + if opts.verbose { + println!("executing query {}", sql); + } else { + if query_index % 100 == 0 { + print!( + "\r{:.2} %", + (query_index as f64 / nr_iterations as f64 * 100.0) + ); + std::io::stdout().flush().unwrap(); + } + } + } if let Err(e) = conn.execute(&sql, ()).await { match e { limbo::Error::SqlExecutionFailure(e) => { diff --git a/stress/opts.rs b/stress/opts.rs index 00c7b9e96..2475e19ee 100644 --- a/stress/opts.rs +++ b/stress/opts.rs @@ -4,6 +4,14 @@ use clap::{command, Parser}; #[command(name = "limbo_stress")] #[command(author, version, about, long_about = None)] pub struct Opts { + /// Verbose mode + #[clap(short = 'v', long, help = "verbose mode")] + pub verbose: bool, + + /// Silent mode + #[clap(long, help = "silent mode")] + pub silent: bool, + /// Number of threads to run #[clap(short = 't', long, help = "the number of threads", default_value_t = 1)] pub nr_threads: usize,