Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/w1r3/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ async fn runner(
continue;
}
};
for op in [Operation::Read0, Operation::Read1, Operation::Read2] {
for i in 0..(args.read_count) {
let op = Operation::Read(i);
let builder = SampleBuilder::new(&task, iteration, op, size, upload.name.clone());
let sample = match download(&client, &args, &upload).await {
(_, Ok(_)) => builder.success(),
Expand Down Expand Up @@ -503,21 +504,17 @@ impl Sample {
enum Operation {
Resumable,
SingleShot,
Read0,
Read1,
Read2,
Read(i32),
Delete,
}

impl Operation {
fn name(&self) -> &str {
fn name(&self) -> std::borrow::Cow<'static, str> {
match self {
Self::Resumable => "RESUMABLE",
Self::SingleShot => "SINGLE_SHOT",
Self::Read0 => "READ[0]",
Self::Read1 => "READ[1]",
Self::Read2 => "READ[2]",
Self::Delete => "DELETE",
Self::Resumable => "RESUMABLE".into(),
Self::SingleShot => "SINGLE_SHOT".into(),
Self::Read(i) => format!("READ[{i}]").into(),
Self::Delete => "DELETE".into(),
}
}
}
Expand Down Expand Up @@ -697,6 +694,10 @@ struct Args {
#[arg(long, value_parser = parse_duration, default_value = "500ms")]
rampup_period: Duration,

/// Sets the number of reads on each object.
#[arg(long, default_value_t = 3)]
read_count: i32,

/// Disable logs in the `reqwest` layer.
#[arg(long)]
reqwest_logs: bool,
Expand Down
Loading