Added hidden init flag to increase default traffic volume (#234)
This commit is contained in:
committed by
GitHub
parent
2630629cdb
commit
7f99c2828b
@@ -57,6 +57,11 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
|
||||
.help("Port for the socket (if applicable) to listen on in all subsequent runs")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(Arg::with_name("fastmode")
|
||||
.long("fastmode")
|
||||
.hidden(true) // this will prevent this flag from being displayed in `--help`
|
||||
.help("Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init")
|
||||
)
|
||||
}
|
||||
|
||||
async fn try_gateway_registration(
|
||||
@@ -120,6 +125,9 @@ pub fn execute(matches: &ArgMatches) {
|
||||
let mut config = crate::config::Config::new(id);
|
||||
|
||||
config = override_config(config, matches);
|
||||
if matches.is_present("fastmode") {
|
||||
config = config.set_high_default_traffic_volume();
|
||||
}
|
||||
|
||||
let mix_identity_keys = MixIdentityKeyPair::new();
|
||||
|
||||
|
||||
@@ -144,6 +144,13 @@ impl Config {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_high_default_traffic_volume(mut self) -> Self {
|
||||
self.debug.average_packet_delay = 10;
|
||||
self.debug.loop_cover_traffic_average_delay = 20; // 50 cover messages / s
|
||||
self.debug.message_sending_average_delay = 5; // 200 "real" messages / s
|
||||
self
|
||||
}
|
||||
|
||||
// getters
|
||||
pub fn get_config_file_save_location(&self) -> PathBuf {
|
||||
self.config_directory().join(Self::config_file_name())
|
||||
|
||||
Reference in New Issue
Block a user