Skip to content

Commit

Permalink
Test/benches fixes (#636)
Browse files Browse the repository at this point in the history
* add header

* combine into a single workflow

* fix wsrelay commit
  • Loading branch information
themighty1 authored Oct 17, 2024
1 parent 504967d commit 2042089
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 32 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/bench-browser.yml

This file was deleted.

15 changes: 12 additions & 3 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
name: Run Benchmarks
name: Run Benchmarks (Native or Browser)
on:
# manual trigger
workflow_dispatch:
inputs:
bench_type:
description: "Specify the benchmark type (native or browser)"
required: true
default: "native"
type: choice
options:
- native
- browser

jobs:
run-benchmarks:
Expand All @@ -12,7 +21,7 @@ jobs:

- name: Build Docker Image
run: |
docker build -t tlsn-bench . -f ./crates/benches/binary/benches.Dockerfile --build-arg BENCH_TYPE=native
docker build -t tlsn-bench . -f ./crates/benches/binary/benches.Dockerfile --build-arg BENCH_TYPE=${{ github.event.inputs.bench_type }}
- name: Run Benchmarks
run: |
Expand All @@ -24,4 +33,4 @@ jobs:
name: benchmark_graphs
path: |
./crates/benches/binary/runtime_vs_latency.html
./crates/benches/binary/runtime_vs_bandwidth.html
./crates/benches/binary/runtime_vs_bandwidth.html
11 changes: 10 additions & 1 deletion crates/benches/binary/bin/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ fn runtime_vs_latency(all_data: &[Metrics]) -> Result<Chart, Box<dyn std::error:
fn runtime_vs_bandwidth(all_data: &[Metrics]) -> Result<Chart, Box<dyn std::error::Error>> {
const TITLE: &str = "Runtime vs Bandwidth";

let prover_kind: String = all_data
.first()
.map(|s| s.kind.clone().into())
.unwrap_or_default();

let download_data: Vec<Vec<f32>> = all_data
.iter()
.filter(|record| record.name == "download_bandwidth")
Expand All @@ -115,7 +120,11 @@ fn runtime_vs_bandwidth(all_data: &[Metrics]) -> Result<Chart, Box<dyn std::erro

// https://github.com/yuankunzhang/charming
let chart = Chart::new()
.title(Title::new().text(TITLE))
.title(
Title::new()
.text(TITLE)
.subtext(format!("{} Prover", prover_kind)),
)
.tooltip(Tooltip::new().trigger(Trigger::Axis))
.legend(Legend::new().orient(Orient::Vertical))
.toolbox(
Expand Down
2 changes: 1 addition & 1 deletion crates/benches/browser/native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tlsn-benches-browser-core = { workspace = true }
tlsn-benches-library = { workspace = true }

serio = { workspace = true }
websocket-relay = { git = "https://github.com/tlsnotary/tlsn-utils", rev = "6ef048c" }
websocket-relay = { git = "https://github.com/tlsnotary/tlsn-utils", rev = "76c9de0" }

anyhow = { workspace = true }
async-trait = { workspace = true }
Expand Down

0 comments on commit 2042089

Please sign in to comment.