Skip to content

Commit

Permalink
cassandra passthrough flamegraph (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbros committed Mar 29, 2023
1 parent 8809e22 commit c0c07e3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions shotover-proxy/examples/cassandra_flamegraph.rs
@@ -0,0 +1,36 @@
use test_helpers::docker_compose::DockerCompose;
use test_helpers::flamegraph::Perf;
use test_helpers::latte::Latte;
use test_helpers::shotover_process::ShotoverProcessBuilder;

// To get useful results you will need to modify the Cargo.toml like:
// [profile.release]
// #lto = "fat"
// codegen-units = 1
// debug = true

#[tokio::main]
async fn main() {
test_helpers::bench::init();

let latte = Latte::new(10000000, 1);
let config_dir = "example-configs/cassandra-passthrough";
let bench = "read";
{
let _compose = DockerCompose::new(&format!("{}/docker-compose.yaml", config_dir));
latte.init(bench, "localhost:9043");

let shotover =
ShotoverProcessBuilder::new_with_topology(&format!("{}/topology.yaml", config_dir))
.start()
.await;

let perf = Perf::new(shotover.child.as_ref().unwrap().id().unwrap());

println!("Benching Shotover ...");
latte.bench(bench, "localhost:9042");

shotover.shutdown_and_then_consume_events(&[]).await;
perf.flamegraph();
}
}

0 comments on commit c0c07e3

Please sign in to comment.