diff --git a/bin/stress-test/src/main.rs b/bin/stress-test/src/main.rs index b4cb537e1..0d8034e2d 100644 --- a/bin/stress-test/src/main.rs +++ b/bin/stress-test/src/main.rs @@ -221,10 +221,10 @@ fn print_metrics( } } - // Print out the store file size every 1k batches to track the growth of the file. - println!("Store file size every 1k batches:"); + // Print out the store file size every 50 blocks to track the growth of the file. + println!("Store file size every 50 blocks:"); for (i, size) in store_file_size_over_time.iter().enumerate() { - println!("{}: {} bytes", i * 1000, size); + println!("Block {}: {} bytes", i * 50, size); } // Print out the average growth rate of the file @@ -232,7 +232,11 @@ fn print_metrics( let final_size = store_file_size_over_time.last().unwrap(); let growth_rate = (final_size - initial_size) as f64 / num_insertions as f64; - println!("Average growth rate: {} bytes per batch", growth_rate); + println!("Average growth rate: {} bytes per blocks", growth_rate); + + // Print out the avg space used per account + let avg_space_per_account = growth_rate / 255.0; + println!("Average space used per account: {} bytes", avg_space_per_account); } /// Create a new faucet account with a given anchor block. @@ -317,15 +321,16 @@ async fn build_blocks( block_builder.build_block(¤t_block).await.unwrap(); insertion_time_per_block.push(start.elapsed()); current_block.clear(); - } - if counter % 1000 == 0 { - let store_file_size = std::fs::metadata("./miden-store.sqlite3").unwrap().len(); - let wal_file_size = std::fs::metadata("./miden-store.sqlite3-wal").unwrap().len(); - store_file_sizes.push(store_file_size + wal_file_size); - } + // We track the size of the DB every 50 blocks. + if counter % 50 == 0 { + let store_file_size = std::fs::metadata("./miden-store.sqlite3").unwrap().len(); + let wal_file_size = std::fs::metadata("./miden-store.sqlite3-wal").unwrap().len(); + store_file_sizes.push(store_file_size + wal_file_size); + } - counter += 1; + counter += 1; + } } if !current_block.is_empty() {