Expand description
Reads criterion benchmark results from target/criterion/ JSON files and
renders a markdown table similar to criterion-table.
§Example
use criterion_markdown::{ChangeThresholds, Renderer};
fn main() -> anyhow::Result<()> {
let thresholds = ChangeThresholds::default()
.improvement_ratio(1.1)
.strong_improvement_ratio(1.5)
.regression_ratio(0.95);
let markdown = Renderer::new("target/criterion")
.candidate("new")
.baseline_root("artifacts/criterion")
.baseline("main")
.benchmarks(["group/benchmark/1", "group/benchmark/2"])
.change_thresholds(thresholds)
.summary_limit(5)
.title("Benchmark Results")
.collapsible(true)
.render()?;
println!("{markdown}");
Ok(())
}Structs§
- Change
Thresholds - Ratio thresholds controlling change indicators.
- Render
Options - Options for controlling the rendered markdown output.
- Renderer
- Builder for loading Criterion results and rendering them as markdown.
Functions§
- render
- Reads all benchmark results from the given criterion output directory and renders a markdown table.
- render_
with_ options - Like
render, but accepts additionalRenderOptionsto control output.