Skip to content

Commit

Permalink
Rename the arguments name for better clarification in insert example (
Browse files Browse the repository at this point in the history
  • Loading branch information
xinifinity authored Jan 3, 2024
1 parent fab15d7 commit 113ff2f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions firewood/examples/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ struct Args {
#[arg(short, long, default_value = "32", value_parser = string_to_range)]
datalen: RangeInclusive<usize>,
#[arg(short, long, default_value_t = 1)]
batch_keys: usize,
batch_size: usize,
#[arg(short, long, default_value_t = 100)]
inserts: usize,
number_of_batches: usize,
#[arg(short, long, default_value_t = 0, value_parser = clap::value_parser!(u16).range(0..=100))]
read_verify_percent: u16,
#[arg(short, long)]
Expand Down Expand Up @@ -54,7 +54,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
.await
.expect("db initiation should succeed");

let keys = args.batch_keys;
let keys = args.batch_size;
let start = Instant::now();

let mut rng = if let Some(seed) = args.seed {
Expand All @@ -63,7 +63,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
rand::rngs::StdRng::from_entropy()
};

for _ in 0..args.inserts {
for _ in 0..args.number_of_batches {
let keylen = rng.gen_range(args.keylen.clone());
let datalen = rng.gen_range(args.datalen.clone());
let batch: Batch<Vec<u8>, Vec<u8>> = (0..keys)
Expand Down Expand Up @@ -93,7 +93,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
let duration = start.elapsed();
println!(
"Generated and inserted {} batches of size {keys} in {duration:?}",
args.inserts
args.number_of_batches
);

Ok(())
Expand Down

0 comments on commit 113ff2f

Please sign in to comment.