Skip to content

Commit

Permalink
Add thread counter option
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Nov 30, 2023
1 parent 7eba6fd commit 8053feb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/cli/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ pub fn default_settings() -> Option<&'static str> {
return MANAGER.as_ref().clap_matches.value_of("default-settings");
}

pub fn enable_thread_counter() -> bool {
return MANAGER
.as_ref()
.clap_matches
.is_present("enable-thread-counter");
}

// Return the command line used to start this application
pub fn command_line_string() -> String {
std::env::args().collect::<Vec<String>>().join(" ")
Expand Down Expand Up @@ -217,6 +224,12 @@ fn get_clap_matches<'a>() -> clap::ArgMatches<'a> {
.long("enable-tracy")
.help("Turns on the Tracy tool integration. Learn more: https://github.com/wolfpld/tracy")
.takes_value(false),
)
.arg(
clap::Arg::with_name("enable-thread-counter")
.long("enable-thread-counter")
.help("Enable a thread that prints the number of children processes.")
.takes_value(false),
);

matches.get_matches()
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ async fn main() -> Result<(), std::io::Error> {
settings::manager::set_mavlink_endpoint(endpoint);
}

if cli::manager::enable_thread_counter() {
helper::threads::start_thread_counter_thread();
}

stream::webrtc::signalling_server::SignallingServer::default();

if let Err(error) = stream::manager::start_default() {
Expand Down

0 comments on commit 8053feb

Please sign in to comment.