diff --git a/config/perftest-sample.toml b/config/perftest-sample.toml index 570b577..6b0423e 100644 --- a/config/perftest-sample.toml +++ b/config/perftest-sample.toml @@ -7,7 +7,8 @@ rpc_addrs = [ "http://127.0.0.12:3384", "http://127.0.0.13:3385" ] -interval = "1000ms" +interval = "100ms" [follow_blocks] -rpc_addr = "http://127.0.0.11:3383" \ No newline at end of file +rpc_addr = "http://127.0.0.11:3383" +enable = false \ No newline at end of file diff --git a/src/bin/perftest.rs b/src/bin/perftest.rs index 411118c..350167d 100644 --- a/src/bin/perftest.rs +++ b/src/bin/perftest.rs @@ -33,6 +33,7 @@ pub struct SubmitMessageConfig { #[derive(Debug, Clone, Deserialize, Serialize)] pub struct FollowBlocksConfig { pub rpc_addr: String, + pub enable: bool, } #[derive(Debug, Clone, Deserialize, Serialize)] @@ -126,6 +127,9 @@ async fn main() -> Result<(), Box> { let submit_message_handles = start_submit_messages(messages_tx, cfg.clone()); let follow_blocks_handle = tokio::spawn(async move { + if !cfg.follow_blocks.enable { + return; + } let addr = cfg.follow_blocks.rpc_addr.clone(); follow_blocks(addr, blocks_tx).await.unwrap() }); @@ -177,7 +181,9 @@ async fn main() -> Result<(), Box> { time_to_confirmation.clear(); block_times.clear(); iteration += 1; - if iteration > cfg.num_iterations { + + // 0 iterations means go forever + if cfg.num_iterations > 0 && iteration > cfg.num_iterations { for submit_message_handle in submit_message_handles { submit_message_handle.abort(); }