diff --git a/Cargo.lock b/Cargo.lock index d308c4ff771..a71099ac34a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5868,7 +5868,7 @@ dependencies = [ [[package]] name = "nym-network-monitor" -version = "0.1.0" +version = "1.0.2" dependencies = [ "anyhow", "axum 0.7.7", diff --git a/nym-network-monitor/Cargo.toml b/nym-network-monitor/Cargo.toml index d83a39b4010..5984b1ec485 100644 --- a/nym-network-monitor/Cargo.toml +++ b/nym-network-monitor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-network-monitor" -version = "1.0.1" +version = "1.0.2" authors.workspace = true repository.workspace = true homepage.workspace = true @@ -13,7 +13,7 @@ license.workspace = true [dependencies] anyhow = { workspace = true } axum = { workspace = true, features = ["json"] } -clap = { workspace = true, features = ["derive"] } +clap = { workspace = true, features = ["derive", "env"] } dashmap = { workspace = true } futures = { workspace = true } log = { workspace = true } diff --git a/nym-network-monitor/entrypoint.sh b/nym-network-monitor/entrypoint.sh index e6f8ff82566..91a08306398 100755 --- a/nym-network-monitor/entrypoint.sh +++ b/nym-network-monitor/entrypoint.sh @@ -15,7 +15,7 @@ nnm_pid=$! sleep 10 -python -m locust -H http://127.0.0.1:8080 --processes "${processes}" --autostart --autoquit 60 -u "${users}" -t "${timeout}"s & +python -m locust -H http://${NYM_NETWORK_MONITOR_HOST}:${NYM_NETWORK_MONITOR_PORT} --processes "${processes}" --autostart --autoquit 60 -u "${users}" -t "${timeout}"s & locust_pid=$! wait $locust_pid diff --git a/nym-network-monitor/src/main.rs b/nym-network-monitor/src/main.rs index 36b206b7121..e209a64533f 100644 --- a/nym-network-monitor/src/main.rs +++ b/nym-network-monitor/src/main.rs @@ -107,11 +107,11 @@ struct Args { client_lifetime: u64, /// Port to listen on - #[arg(long, default_value_t = 8080)] + #[arg(long, default_value_t = 8080, env = "NYM_NETWORK_MONITOR_PORT")] port: u16, /// Host to listen on - #[arg(long, default_value = "127.0.0.1")] + #[arg(long, default_value = "127.0.0.1", env = "NYM_NETWORK_MONITOR_HOST")] host: String, /// Path to the topology file