Skip to content

Commit

Permalink
chore: backfill the data to fit multiple metrics benchmarking (#468)
Browse files Browse the repository at this point in the history
*Description of changes:*
The Go multiple metric benchmarking was fixed in upstream.
benchmark-action/github-action-benchmark#118

Backfilling it for Finch.

Backfilled by the script
```
let obj = window.BENCHMARK_DATA;
for (let benchmark of obj.entries["Finch Benchmark"]) {
  let newBenches = [];
  for (let bench of benchmark.benches) {
    let metrics = bench.unit.split("\t").filter(el => el !== "");
    // If data already split, skip
    if(metrics.length === 1) {
      newBenches.push(bench);
      continue;
    }
    // handle the first metric
    let firstMetric = metrics[0].trim();
    let newBench = JSON.parse(JSON.stringify(bench)); // Deep clone
    newBench.name += " - " + firstMetric;
    newBench.unit = firstMetric;
    newBenches.push(newBench);
    // handle the rest of the metrics
    for (let i = 1; i < metrics.length; i++) {
      let metric = metrics[i].trim().split(" ");
      let value = metric[0];
      let unit = metric[1];
      let newBench = JSON.parse(JSON.stringify(bench)); // Deep clone
      newBench.name += " - " + unit;
      newBench.unit = unit;
      newBench.value = value;
      newBenches.push(newBench);
    }
  }
  benchmark.benches = newBenches;
}
console.log(JSON.stringify(obj, null, 2));
```

*Testing done:*
By locally exploring the index.html in Chrome.


- [ X ] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

Signed-off-by: Ziwen Ning <[email protected]>
  • Loading branch information
ningziwen authored Jul 7, 2023
1 parent d98f981 commit a08c00f
Show file tree
Hide file tree
Showing 4 changed files with 32,391 additions and 8,055 deletions.
Loading

0 comments on commit a08c00f

Please sign in to comment.