Expand description
Reads criterion benchmark results from target/criterion/ JSON files and
renders a markdown table similar to criterion-table.
§Example
use criterion_markdown::{Emojis, Renderer, Thresholds};
fn main() -> anyhow::Result<()> {
let thresholds = Thresholds::default()
.improvement_ratio(1.1)
.strong_improvement_ratio(1.5)
.regression_ratio(0.95);
let emojis = Emojis::default().strong_improvement("🔥");
let markdown = Renderer::new("target/criterion")
.candidate("new")
.baseline_root("artifacts/criterion")
.baseline("main")
.benchmarks(["group/benchmark/1", "group/benchmark/2"])
.thresholds(thresholds)
.emojis(emojis)
.summary_limit(5)
.title("Benchmark Results")
.collapsible(true)
.render()?;
println!("{markdown}");
Ok(())
}Structs§
- Emojis
- Emojis used to represent benchmark change classifications.
- Renderer
- Builder for loading Criterion results and rendering them as markdown.
- Thresholds
- Ratio thresholds controlling change indicators.