Skip to content

Commit

Permalink
Remove download changes, add bind arg to client_benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Carl Jones <[email protected]>
  • Loading branch information
dannycjones committed Feb 28, 2025
1 parent 6123df6 commit fdfca13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
9 changes: 9 additions & 0 deletions mountpoint-s3-client/examples/client_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ struct CliArgs {
visible_alias = "maximum-throughput-gbps"
)]
throughput_target_gbps: f64,
#[clap(
long,
help = "One or more network interfaces to use when accessing S3. Requires Linux 5.7+ or running as root.",
value_name = "NETWORK_INTERFACE"
)]
pub bind: Option<Vec<String>>,
#[arg(long, help = "Part size for multi-part GET", default_value = "8388608")]
part_size: usize,
#[arg(long, help = "Number of benchmark iterations", default_value = "1")]
Expand All @@ -125,6 +131,9 @@ fn main() {
Client::Real { bucket, key, region } => {
let mut config = S3ClientConfig::new().endpoint_config(EndpointConfig::new(&region));
config = config.throughput_target_gbps(args.throughput_target_gbps);
if let Some(interfaces) = &args.bind {
config = config.network_interface_names(interfaces.clone());
}
config = config.part_size(args.part_size);
let client = S3CrtClient::new(config).expect("couldn't create client");

Expand Down
27 changes: 2 additions & 25 deletions mountpoint-s3-client/examples/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,6 @@ pub struct CliArgs {
value_parser = parse_range,
)]
pub range: Option<Range<u64>>,

#[arg(
long,
help = "Configure S3 client's desired throughput in Gbps",
default_value_t = 10.0,
visible_alias = "maximum-throughput-gbps",
value_name = "GBPS"
)]
throughput_target_gbps: f64,

#[clap(
long,
help = "One or more network interfaces to use when accessing S3. Requires Linux 5.7+ or running as root.",
value_name = "NETWORK_INTERFACE"
)]
pub bind: Option<Vec<String>>,
}

/// Empty error type, since we don't care too much for an example.
Expand Down Expand Up @@ -96,15 +80,8 @@ fn main() {
let region = &args.region;
let range = args.range;

let mut config = S3ClientConfig::new();

config = config.endpoint_config(EndpointConfig::new(region));
config = config.throughput_target_gbps(args.throughput_target_gbps);
if let Some(interfaces) = &args.bind {
config = config.network_interface_names(interfaces.clone());
}

let client = S3CrtClient::new(config).expect("couldn't create client");
let client = S3CrtClient::new(S3ClientConfig::new().endpoint_config(EndpointConfig::new(region)))
.expect("couldn't create client");

let last_offset = Arc::new(Mutex::new(None));
let last_offset_clone = Arc::clone(&last_offset);
Expand Down

0 comments on commit fdfca13

Please sign in to comment.