diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 21279c2..c197214 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -12,4 +12,4 @@ opt-level = 3 [profile.release] lto = true panic = "abort" -debug = true \ No newline at end of file +# debug = true \ No newline at end of file diff --git a/backend/telemetry_core/tests/soak_tests.rs b/backend/telemetry_core/tests/soak_tests.rs index 6b91a08..6b05248 100644 --- a/backend/telemetry_core/tests/soak_tests.rs +++ b/backend/telemetry_core/tests/soak_tests.rs @@ -16,38 +16,6 @@ sudo sysctl -w kern.ipc.maxsockbuf=16777216 In general, if you run into issues, it may be better to run this on a linux box; MacOS seems to hit limits quicker in general. - -We can profile execution using cargo-flamegraph to learn more about how long -we spend in each function. - -The main thing to do is install it: - -```sh -cargo install flamegraph -``` - -Now, start processes running ourselves (so that we can use flamegraph on them): - -In one terminal (in the `backend` folder of this repo): - -```sh -sudo cargo flamegraph -o telemetry_core.svg --bin telemetry_core -``` - -And in another: - -```sh -sudo cargo flamegraph -o telemetry_shard.svg --bin telemetry_shard -``` - -And then, in a third terminal, we can run our general soak test against these: - -```sh -SOAK_TEST_ARGS='--feeds 100 --nodes 100 --shards 4' \ -TELEMETRY_SUBMIT_HOSTS='127.0.0.1:8001' \ -TELEMETRY_FEED_HOST='127.0.0.1:8000' \ -cargo test -- soak_test --ignored --nocapture -``` */ use futures::{ StreamExt }; @@ -67,12 +35,17 @@ use common::node_types::BlockHash; /// SOAK_TEST_ARGS='--feeds 10 --nodes 100 --shards 4' cargo test -- soak_test --ignored --nocapture /// ``` /// -/// You can also run this test against the pre-sharding actix binary like so: +/// You can also run this test against the pre-sharding actix binary with something like this: /// ```sh /// TELEMETRY_BIN=~/old_telemetry_binary SOAK_TEST_ARGS='--feeds 100 --nodes 100 --shards 4' cargo test -- soak_test --ignored --nocapture /// ``` /// -/// Both will establish the same total number of connections and same the same messages. +/// Or, you can run it against existing processes with something like this: +/// ```sh +/// TELEMETRY_SUBMIT_HOSTS='127.0.0.1:8001' TELEMETRY_FEED_HOST='127.0.0.1:8000' SOAK_TEST_ARGS='--feeds 100 --nodes 100 --shards 4' cargo test -- soak_test --ignored --nocapture +/// ``` +/// +/// Each will establish the same total number of connections and send the same messages. #[ignore] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] pub async fn soak_test() { diff --git a/backend/test_utils/src/workspace/commands.rs b/backend/test_utils/src/workspace/commands.rs index 595b2b2..df7f97a 100644 --- a/backend/test_utils/src/workspace/commands.rs +++ b/backend/test_utils/src/workspace/commands.rs @@ -21,7 +21,7 @@ fn telemetry_command(bin: &'static str, release_mode: bool) -> Result