,
}
@@ -759,15 +760,32 @@ impl Html {
let value_types: Vec<_> = data.iter().map(|&&(id, _)| id.value_type()).collect();
let mut line_path = None;
+ let mut line_throughput_path = None;
if value_types.iter().all(|x| x == &value_types[0]) {
if let Some(value_type) = value_types[0] {
let values: Vec<_> = data.iter().map(|&&(id, _)| id.as_number()).collect();
if values.iter().any(|x| x != &values[0]) {
- self.plotter
- .borrow_mut()
- .line_comparison(plot_ctx, formatter, data, value_type);
+ self.plotter.borrow_mut().line_comparison(
+ LinePlotConfig::time(),
+ plot_ctx,
+ formatter,
+ data,
+ value_type,
+ );
line_path = Some(plot_ctx.line_comparison_path());
+
+ // value_types being all equal implies throughput types being all equal
+ if data[0].0.throughput.is_some() {
+ self.plotter.borrow_mut().line_comparison(
+ LinePlotConfig::throughput(),
+ plot_ctx,
+ formatter,
+ data,
+ value_type,
+ );
+ line_throughput_path = Some(plot_ctx.line_throughput_comparison_path());
+ }
}
}
}
@@ -788,6 +806,7 @@ impl Html {
violin_plot: Some(plot_ctx.violin_path().to_string_lossy().into_owned()),
line_chart: line_path.map(|p| p.to_string_lossy().into_owned()),
+ line_throughput_chart: line_throughput_path.map(|p| p.to_string_lossy().into_owned()),
benchmarks,
};
diff --git a/src/html/summary_report.html.tt b/src/html/summary_report.html.tt
index 4f36f62b..e6f43106 100644
--- a/src/html/summary_report.html.tt
+++ b/src/html/summary_report.html.tt
@@ -66,6 +66,11 @@
This chart shows the mean measured time for each function as the input (or the size of the input) increases.
{{- endif }}
+ {{- if line_throughput_chart }}
+ Throughput Chart
+
+ This chart shows the mean measured throughput for each function as the input (or the size of the input) increases.
+ {{- endif }}
{{- for bench in benchmarks }}