Added hidden init flag to increase default traffic volume (#234)

This commit is contained in:
Jędrzej Stuczyński
2020-05-15 10:09:27 +01:00
committed by GitHub
parent 2630629cdb
commit 7f99c2828b
2 changed files with 15 additions and 0 deletions
+8
View File
@@ -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();
+7
View File
@@ -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())