Skip to content

Commit 7f99c28

Browse files
authoredMay 15, 2020
Added hidden init flag to increase default traffic volume (#234)
1 parent 2630629 commit 7f99c28

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
 

‎clients/desktop/src/commands/init.rs

+8
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
5757
.help("Port for the socket (if applicable) to listen on in all subsequent runs")
5858
.takes_value(true)
5959
)
60+
.arg(Arg::with_name("fastmode")
61+
.long("fastmode")
62+
.hidden(true) // this will prevent this flag from being displayed in `--help`
63+
.help("Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init")
64+
)
6065
}
6166

6267
async fn try_gateway_registration(
@@ -120,6 +125,9 @@ pub fn execute(matches: &ArgMatches) {
120125
let mut config = crate::config::Config::new(id);
121126

122127
config = override_config(config, matches);
128+
if matches.is_present("fastmode") {
129+
config = config.set_high_default_traffic_volume();
130+
}
123131

124132
let mix_identity_keys = MixIdentityKeyPair::new();
125133

‎clients/desktop/src/config/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ impl Config {
144144
self
145145
}
146146

147+
pub fn set_high_default_traffic_volume(mut self) -> Self {
148+
self.debug.average_packet_delay = 10;
149+
self.debug.loop_cover_traffic_average_delay = 20; // 50 cover messages / s
150+
self.debug.message_sending_average_delay = 5; // 200 "real" messages / s
151+
self
152+
}
153+
147154
// getters
148155
pub fn get_config_file_save_location(&self) -> PathBuf {
149156
self.config_directory().join(Self::config_file_name())

0 commit comments

Comments
 (0)
Please sign in to comment.