diff --git a/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py b/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py index 59764db3..41ef0c1e 100755 --- a/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py +++ b/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py @@ -215,7 +215,10 @@ def plot_evaluation_latency(path, variant): data = pd.read_csv(f"{path}/evaluation_{variant}.csv"); fig, ax = plt.subplots(1,1,figsize=(6,4)) - ax.scatter(data['size'][:5000], data['latency_ns'][:5000], marker='x') + reads = data[data['op'] == 'r'] + writes = data[data['op'] == 'w'] + ax.scatter(reads['size'], reads['latency_ns'], marker='x') + ax.scatter(writes['size'], writes['latency_ns'], marker='.') xticks = np.arange(0, 12 * 1024 * 1024 + 1, 2 * 1024 * 1024) ax.set_xticks(xticks, [int(x / 1024) for x in xticks]) ax.set_xlabel("Size in KiB") @@ -223,7 +226,7 @@ def plot_evaluation_latency(path, variant): ax.set_yscale("log") label=' | '.join(path.split('/')[-2:]) ax.set_title(f"Haura - {label}") - fig.savefig(f"{path}/evaluation_read.svg") + fig.savefig(f"{path}/evaluation_{variant}.svg") plt.close(fig) USAGE_HELP="""Please specify an input run directory. If you already completed \ diff --git a/betree/haura-benchmarks/src/main.rs b/betree/haura-benchmarks/src/main.rs index d7403775..2a4629d6 100644 --- a/betree/haura-benchmarks/src/main.rs +++ b/betree/haura-benchmarks/src/main.rs @@ -108,7 +108,7 @@ fn run_all(mode: Mode) -> Result<(), Box> { min_size, max_size, }; - scientific_evaluation::run_read_write(client, config, 1.0)?; + scientific_evaluation::run_read_write(client, config, 1.0, "read")?; control.database.write().sync()?; } Mode::EvaluationRW { @@ -127,7 +127,7 @@ fn run_all(mode: Mode) -> Result<(), Box> { min_size, max_size, }; - scientific_evaluation::run_read_write(client, config, ratio.clamp(0.0, 1.0))?; + scientific_evaluation::run_read_write(client, config, ratio.clamp(0.0, 1.0), "rw")?; control.database.write().sync()?; } Mode::Zip { diff --git a/betree/haura-benchmarks/src/scientific_evaluation.rs b/betree/haura-benchmarks/src/scientific_evaluation.rs index 7761e642..679a90b4 100644 --- a/betree/haura-benchmarks/src/scientific_evaluation.rs +++ b/betree/haura-benchmarks/src/scientific_evaluation.rs @@ -47,6 +47,7 @@ pub fn run_read_write( mut client: Client, config: EvaluationConfig, rw: f64, + name: &str, ) -> Result<(), Box> { println!("running scientific_evaluation"); // Generate positions to read @@ -64,7 +65,7 @@ pub fn run_read_write( let f = std::fs::OpenOptions::new() .write(true) .create(true) - .open("evaluation_read_write.csv")?; + .open("evaluation_{name}.csv")?; let mut w = std::io::BufWriter::new(f); w.write_all(b"offset,size,latency_ns,op\n")?; for (pos, len) in positions.iter().cycle() {