Skip to content

Commit

Permalink
Remove inferno dependency (#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored Jan 25, 2024
1 parent 6574120 commit 0d7165e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 196 deletions.
63 changes: 0 additions & 63 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion shotover-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ cql-ws = { git = "https://github.com/shotover/cql-ws" }
opensearch = "2.1.0"
serde_json = "1.0.103"
time = { version = "0.3.25" }
inferno = { version = "0.11.15", default-features = false, features = ["multithreaded", "nameattr"] }
hyper.workspace = true
shell-quote.workspace = true

Expand Down
26 changes: 1 addition & 25 deletions shotover-proxy/benches/windsock/profilers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,28 @@ use self::{samply::Samply, shotover_metrics::ShotoverMetrics};
use crate::common::Shotover;
use anyhow::Result;
use aws_throwaway::Ec2Instance;
use perf_flamegraph::Perf;
use std::{collections::HashMap, path::PathBuf};
use test_helpers::shotover_process::BinProcess;
use tokio::sync::mpsc::UnboundedReceiver;
use windsock::Profiling;

mod perf_flamegraph;
mod samply;
mod sar;
mod shotover_metrics;

pub struct ProfilerRunner {
bench_name: String,
run_flamegraph: bool,
run_samply: bool,
run_shotover_metrics: bool,
run_sys_monitor: bool,
results_path: PathBuf,
perf: Option<Perf>,
shotover_metrics: Option<ShotoverMetrics>,
samply: Option<Samply>,
sys_monitor: Option<UnboundedReceiver<Result<String>>>,
}

impl ProfilerRunner {
pub fn new(bench_name: String, profiling: Profiling) -> Self {
let run_flamegraph = profiling
.profilers_to_use
.contains(&"flamegraph".to_owned());
let run_samply = profiling.profilers_to_use.contains(&"samply".to_owned());
let run_sys_monitor = profiling
.profilers_to_use
Expand All @@ -41,31 +34,17 @@ impl ProfilerRunner {

ProfilerRunner {
bench_name,
run_flamegraph,
run_sys_monitor,
run_samply,
run_shotover_metrics,
results_path: profiling.results_path,
perf: None,
shotover_metrics: None,
samply: None,
sys_monitor: None,
}
}

pub async fn run(&mut self, shotover: &Option<BinProcess>) {
self.perf = if self.run_flamegraph {
if let Some(shotover) = &shotover {
Some(Perf::new(
self.results_path.clone(),
shotover.child().id().unwrap(),
))
} else {
panic!("flamegraph not supported when benching without shotover")
}
} else {
None
};
self.shotover_metrics = if self.run_shotover_metrics {
if shotover.is_some() {
Some(ShotoverMetrics::new(self.bench_name.clone(), "localhost"))
Expand All @@ -92,7 +71,7 @@ impl ProfilerRunner {
}

pub fn shotover_profile(&self) -> Option<&'static str> {
if self.run_flamegraph || self.run_samply {
if self.run_samply {
Some("profiling")
} else {
None
Expand All @@ -102,9 +81,6 @@ impl ProfilerRunner {

impl Drop for ProfilerRunner {
fn drop(&mut self) {
if let Some(perf) = self.perf.take() {
perf.flamegraph();
}
if let Some(samply) = self.samply.take() {
samply.wait();
}
Expand Down
107 changes: 0 additions & 107 deletions shotover-proxy/benches/windsock/profilers/perf_flamegraph.rs

This file was deleted.

0 comments on commit 0d7165e

Please sign in to comment.