Skip to content

Commit

Permalink
Buffer size only for kuksa.val.v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeling committed Nov 28, 2024
1 parent b61cee6 commit 3029511
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ struct Args {
detailed_output: bool,

/// Seconds to run (skip) before measuring the latency.
#[clap(long, display_order = 7, default_value_t = 10)]
buffer_size: u32,
#[clap(long, display_order = 7)]
buffer_size: Option<u32>,

/// Path to test data file
#[clap(long = "test-data-file", display_order = 7, value_name = "FILE")]
Expand Down Expand Up @@ -128,11 +128,18 @@ async fn main() -> Result<()> {
}
}

let mut api = Api::KuksaValV1;
if args.api.contains("sdv.databroker.v1") {
api = Api::SdvDatabrokerV1;
let api = if args.api.contains("sdv.databroker.v1") {
Api::SdvDatabrokerV1
} else if args.api.contains("kuksa.val.v2") {
api = Api::KuksaValV2;
Api::KuksaValV2
} else {
Api::KuksaValV1
};

if let Some(_) = args.buffer_size {
if matches!(api, Api::SdvDatabrokerV1 | Api::KuksaValV1) {
println!("Warning: buffer_size will be ignored, only supported for kuksa.val.v2 API");
}
}

let config_groups = read_config(args.test_data_file.as_ref())?;
Expand Down

0 comments on commit 3029511

Please sign in to comment.