mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-17 20:51:01 +00:00
Remove flamegraph bits
This commit is contained in:
+1
-1
@@ -12,4 +12,4 @@ opt-level = 3
|
|||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
debug = true
|
# debug = true
|
||||||
@@ -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
|
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.
|
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 };
|
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
|
/// 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
|
/// ```sh
|
||||||
/// TELEMETRY_BIN=~/old_telemetry_binary SOAK_TEST_ARGS='--feeds 100 --nodes 100 --shards 4' cargo test -- soak_test --ignored --nocapture
|
/// 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]
|
#[ignore]
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
|
||||||
pub async fn soak_test() {
|
pub async fn soak_test() {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ fn telemetry_command(bin: &'static str, release_mode: bool) -> Result<Command, s
|
|||||||
let mut workspace_dir = try_find_workspace_dir()?;
|
let mut workspace_dir = try_find_workspace_dir()?;
|
||||||
workspace_dir.push("Cargo.toml");
|
workspace_dir.push("Cargo.toml");
|
||||||
|
|
||||||
let mut cmd = Command::new("cargo").arg("flamegraph");
|
let mut cmd = Command::new("cargo").arg("run");
|
||||||
|
|
||||||
// Release mode?
|
// Release mode?
|
||||||
if release_mode {
|
if release_mode {
|
||||||
|
|||||||
Reference in New Issue
Block a user