Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mock-mount-s3 to require '--max-throughput-gbps' argument #1018

Merged
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
10 changes: 8 additions & 2 deletions mountpoint-s3/src/bin/mock-mount-s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//!
//! This binary is intended only for use in testing and development of Mountpoint.

use anyhow::anyhow;
use futures::executor::ThreadPool;

use mountpoint_s3::cli::CliArgs;
use mountpoint_s3::s3::S3Personality;
use mountpoint_s3_client::mock_client::throughput_client::ThroughputMockClient;
Expand All @@ -32,7 +34,11 @@ fn create_mock_client(args: &CliArgs) -> anyhow::Result<(ThroughputMockClient, T

tracing::warn!("using mock client");

let max_throughput_gbps = args.maximum_throughput_gbps.unwrap_or(10) as f64;
let Some(max_throughput_gbps) = args.maximum_throughput_gbps else {
return Err(anyhow!(
"must set --maximum-throughput-gbps when using mock-mount-s3 binary"
));
};
tracing::info!("mock client target network throughput {max_throughput_gbps} Gbps");

let config = MockClientConfig {
Expand All @@ -41,7 +47,7 @@ fn create_mock_client(args: &CliArgs) -> anyhow::Result<(ThroughputMockClient, T
unordered_list_seed: None,
..Default::default()
};
let client = ThroughputMockClient::new(config, max_throughput_gbps);
let client = ThroughputMockClient::new(config, max_throughput_gbps as f64);

let runtime = ThreadPool::builder().name_prefix("runtime").create()?;

Expand Down
Loading