Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion linera-client/src/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ where
blocks_infos: Vec<(ChainId, Vec<Operation>, AccountSecretKey)>,
committee: Committee,
local_node: LocalNodeClient<S>,
keep_chains_open: bool,
) -> Result<(), Error> {
let shutdown_notifier = CancellationToken::new();
tokio::spawn(listen_for_shutdown_signals(shutdown_notifier.clone()));
Expand Down Expand Up @@ -143,6 +144,7 @@ where
sender,
committee,
local_node,
keep_chains_open,
)
.await?;

Expand Down Expand Up @@ -179,6 +181,7 @@ where
sender: crossbeam_channel::Sender<()>,
committee: Committee,
local_node: LocalNodeClient<S>,
keep_chains_open: bool,
) -> Result<(), Error> {
let chain_id = chain_client.chain_id();
info!(
Expand Down Expand Up @@ -237,7 +240,9 @@ where
}
}

Self::close_benchmark_chain(chain_client).await?;
if !keep_chains_open {
Self::close_benchmark_chain(chain_client).await?;
}
info!("Exiting task...");
Ok(())
}
Expand Down
5 changes: 5 additions & 0 deletions linera-client/src/client_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,11 @@ pub enum ClientCommand {
/// provided fixed BPS rate.
#[arg(long)]
bps: Option<usize>,

/// If provided, will not close the chains after the benchmark is finished. This is useful
/// when running with many chains, as closing them all might take a while.
#[arg(long)]
keep_chains_open: bool,
},

/// Create genesis configuration for a Linera deployment.
Expand Down
2 changes: 2 additions & 0 deletions linera-service/src/linera/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ impl Runnable for Job {
transactions_per_block,
fungible_application_id,
bps,
keep_chains_open,
} => {
assert!(num_chains > 0, "Number of chains must be greater than 0");
assert!(
Expand Down Expand Up @@ -769,6 +770,7 @@ impl Runnable for Job {
blocks_infos,
committee,
context.client.local_node().clone(),
keep_chains_open,
)
.await?;
}
Expand Down