Consistent display name

This commit is contained in:
David Peter committed 2026-10-05 21:02:52 +02:00
1 parent eedec07812
commit 579b762790
8 files changed
+34 -40

No files matched your search

+2 -4
View File
@@ -82,6 +82,7 @@ fn test_csv() {
BenchmarkResult {
command: String::from("echo command_a"),
name: Some(String::from("command_a")),
display_name: String::from("command_a"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(7.0),
@@ -111,14 +112,12 @@ fn test_csv() {
"foo".into(),
Parameter {
value: "one".into(),
is_unused: false,
},
);
params.insert(
"bar".into(),
Parameter {
value: "two".into(),
is_unused: false,
},
);
params
@@ -127,6 +126,7 @@ fn test_csv() {
BenchmarkResult {
command: String::from("command_b"),
name: None,
display_name: String::from("command_b"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(17.0),
@@ -156,14 +156,12 @@ fn test_csv() {
"foo".into(),
Parameter {
value: "one".into(),
is_unused: false,
},
);
params.insert(
"bar".into(),
Parameter {
value: "seven".into(),
is_unused: false,
},
);
params
+1 -1
View File
@@ -50,7 +50,7 @@ pub trait MarkupExporter {
for entry in entries {
let result = &entry.result;
// prepare data row strings
let cmd_str = result.command_with_unused_parameters().replace('|', "\\|");
let cmd_str = result.display_name.replace('|', "\\|");
let mean_str = result.mean_wall_clock_time().format_value(time_unit);
let stddev_str = if let Some(stddev) = result.measurements.stddev() {
format!(" ± {}", stddev.format_value(time_unit))
+8
View File
@@ -29,6 +29,7 @@ fn test_markup_export_auto_ms() {
BenchmarkResult {
command: String::from("sleep 0.1"),
name: None,
display_name: String::from("sleep 0.1"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(0.09),
@@ -57,6 +58,7 @@ fn test_markup_export_auto_ms() {
BenchmarkResult {
command: String::from("sleep 2"),
name: None,
display_name: String::from("sleep 2"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(2.0),
@@ -130,6 +132,7 @@ fn test_markup_export_auto_s() {
BenchmarkResult {
command: String::from("sleep 2"),
name: None,
display_name: String::from("sleep 2"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(2.1),
@@ -158,6 +161,7 @@ fn test_markup_export_auto_s() {
BenchmarkResult {
command: String::from("sleep 0.1"),
name: None,
display_name: String::from("sleep 0.1"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(0.1),
@@ -231,6 +235,7 @@ fn test_markup_export_manual_ms() {
BenchmarkResult {
command: String::from("sleep 2"),
name: None,
display_name: String::from("sleep 2"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(2.1),
@@ -259,6 +264,7 @@ fn test_markup_export_manual_ms() {
BenchmarkResult {
command: String::from("sleep 0.1"),
name: None,
display_name: String::from("sleep 0.1"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(0.1),
@@ -331,6 +337,7 @@ fn test_markup_export_manual_s() {
BenchmarkResult {
command: String::from("sleep 2"),
name: None,
display_name: String::from("sleep 2"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(2.01),
@@ -359,6 +366,7 @@ fn test_markup_export_manual_s() {
BenchmarkResult {
command: String::from("sleep 0.1"),
name: None,
display_name: String::from("sleep 0.1"),
measurements: Measurements::new(vec![
Measurement {
time_wall_clock: Time::new::<second>(0.11),