diff --git a/conf.json b/conf.json index 548a1d83..063128ec 100644 --- a/conf.json +++ b/conf.json @@ -8,4 +8,4 @@ "capacity_multiplier": 2, "no_results": false, "log_interval": 60 -} \ No newline at end of file +} diff --git a/sim-cli/src/config.rs b/sim-cli/src/config.rs index 3a7928c7..d9d234a1 100644 --- a/sim-cli/src/config.rs +++ b/sim-cli/src/config.rs @@ -206,4 +206,4 @@ mod test { assert_eq!(Some(conf.no_results), cli.no_results); } -} \ No newline at end of file +} diff --git a/sim-lib/src/lib.rs b/sim-lib/src/lib.rs index 51f9e893..222ef089 100644 --- a/sim-lib/src/lib.rs +++ b/sim-lib/src/lib.rs @@ -334,6 +334,8 @@ pub struct Simulation { activity_multiplier: f64, /// Configurations for printing results to CSV. Results are not written if this option is None. write_results: Option, + /// Duration after which results are logged + log_interval: u64, } #[derive(Clone)] @@ -352,6 +354,7 @@ impl Simulation { expected_payment_msat: u64, activity_multiplier: f64, write_results: Option, + log_interval: u64, ) -> Self { let (shutdown_trigger, shutdown_listener) = triggered::trigger(); Self { @@ -363,6 +366,7 @@ impl Simulation { expected_payment_msat, activity_multiplier, write_results, + log_interval, } } @@ -559,7 +563,7 @@ impl Simulation { tasks.spawn(run_results_logger( listener.clone(), result_logger.clone(), - Duration::from_secs(60), + Duration::from_secs(self.log_interval), )); tasks.spawn(consume_simulation_results(