Skip to content

Commit 03ebe41

Browse files
Simplify the environment info presentation
The formatting for the summary information in the output files was updated to enhance readability. This mainly consists of replacing equal signs with colons and slight changes in the placement of certain pieces of information.
1 parent 48a7b65 commit 03ebe41

File tree

30 files changed

+104
-104
lines changed

30 files changed

+104
-104
lines changed

src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,24 @@ public override IEnumerable<string> ToFormattedString()
8585
string vmName = VirtualMachineHypervisor.Value?.Name;
8686

8787
if (!string.IsNullOrEmpty(vmName))
88-
yield return $"{BenchmarkDotNetCaption}=v{BenchmarkDotNetVersion}, OS={OsVersion.Value}, VM={vmName}";
88+
yield return $"{BenchmarkDotNetCaption} v{BenchmarkDotNetVersion}, {OsVersion.Value} ({vmName})";
8989
else if (RuntimeInformation.IsRunningInContainer)
90-
yield return $"{BenchmarkDotNetCaption}=v{BenchmarkDotNetVersion}, OS={OsVersion.Value} (container)";
90+
yield return $"{BenchmarkDotNetCaption} v{BenchmarkDotNetVersion}, {OsVersion.Value} (container)";
9191
else
92-
yield return $"{BenchmarkDotNetCaption}=v{BenchmarkDotNetVersion}, OS={OsVersion.Value}";
92+
yield return $"{BenchmarkDotNetCaption} v{BenchmarkDotNetVersion}, {OsVersion.Value}";
9393

9494
yield return CpuInfoFormatter.Format(CpuInfo.Value);
9595
var cultureInfo = DefaultCultureInfo.Instance;
9696
if (HardwareTimerKind != HardwareTimerKind.Unknown)
97-
yield return $"Frequency={ChronometerFrequency}, Resolution={ChronometerResolution.ToString(cultureInfo)}, Timer={HardwareTimerKind.ToString().ToUpper()}";
97+
yield return $"Frequency: {ChronometerFrequency}, Resolution: {ChronometerResolution.ToString(cultureInfo)}, Timer: {HardwareTimerKind.ToString().ToUpper()}";
9898

9999
if (RuntimeInformation.IsNetCore && IsDotNetCliInstalled())
100100
{
101101
// this wonderful version number contains words like "preview" and ... 5 segments so it can not be parsed by Version.Parse. Example: "5.0.100-preview.8.20362.3"
102102
if (int.TryParse(new string(DotNetSdkVersion.Value.TrimStart().TakeWhile(char.IsDigit).ToArray()), out int major) && major >= 5)
103-
yield return $".NET SDK={DotNetSdkVersion.Value}";
103+
yield return $".NET SDK {DotNetSdkVersion.Value}";
104104
else
105-
yield return $".NET Core SDK={DotNetSdkVersion.Value}";
105+
yield return $".NET Core SDK {DotNetSdkVersion.Value}";
106106
}
107107
}
108108

src/BenchmarkDotNet/Exporters/MarkdownExporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public enum MarkdownHighlightStrategy
4848
{
4949
Dialect = nameof(GitHub),
5050
UseCodeBlocks = true,
51-
CodeBlockStart = "``` ini",
51+
CodeBlockStart = "```",
5252
StartOfGroupHighlightStrategy = MarkdownHighlightStrategy.Bold,
5353
ColumnsStartWithSeparator = true,
5454
EscapeHtml = true

tests/BenchmarkDotNet.Tests/Attributes/VerifiedFiles/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithAllValuesOfBool.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== WithAllValuesOfBool ===
22

3-
BenchmarkDotNet=v0.10.x-mock, OS=Microsoft Windows NT 10.0.x.mock, VM=Hyper-V
3+
BenchmarkDotNet v0.10.x-mock, Microsoft Windows NT 10.0.x.mock (Hyper-V)
44
MockIntel Core i7-6700HQ CPU 2.60GHz (Max: 3.10GHz), 1 CPU, 8 logical and 4 physical cores
5-
Frequency=2531248 Hz, Resolution=395.0620 ns, Timer=TSC
5+
Frequency: 2531248 Hz, Resolution: 395.0620 ns, Timer: TSC
66
[Host] : Clr 4.0.x.mock, 64mock RyuJIT-v4.6.x.mock CONFIGURATION
77
DefaultJob : extra output line
88

tests/BenchmarkDotNet.Tests/Attributes/VerifiedFiles/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithAllValuesOfEnum.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== WithAllValuesOfEnum ===
22

3-
BenchmarkDotNet=v0.10.x-mock, OS=Microsoft Windows NT 10.0.x.mock, VM=Hyper-V
3+
BenchmarkDotNet v0.10.x-mock, Microsoft Windows NT 10.0.x.mock (Hyper-V)
44
MockIntel Core i7-6700HQ CPU 2.60GHz (Max: 3.10GHz), 1 CPU, 8 logical and 4 physical cores
5-
Frequency=2531248 Hz, Resolution=395.0620 ns, Timer=TSC
5+
Frequency: 2531248 Hz, Resolution: 395.0620 ns, Timer: TSC
66
[Host] : Clr 4.0.x.mock, 64mock RyuJIT-v4.6.x.mock CONFIGURATION
77
DefaultJob : extra output line
88

tests/BenchmarkDotNet.Tests/Attributes/VerifiedFiles/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithAllValuesOfNullableBool.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== WithAllValuesOfNullableBool ===
22

3-
BenchmarkDotNet=v0.10.x-mock, OS=Microsoft Windows NT 10.0.x.mock, VM=Hyper-V
3+
BenchmarkDotNet v0.10.x-mock, Microsoft Windows NT 10.0.x.mock (Hyper-V)
44
MockIntel Core i7-6700HQ CPU 2.60GHz (Max: 3.10GHz), 1 CPU, 8 logical and 4 physical cores
5-
Frequency=2531248 Hz, Resolution=395.0620 ns, Timer=TSC
5+
Frequency: 2531248 Hz, Resolution: 395.0620 ns, Timer: TSC
66
[Host] : Clr 4.0.x.mock, 64mock RyuJIT-v4.6.x.mock CONFIGURATION
77
DefaultJob : extra output line
88

tests/BenchmarkDotNet.Tests/Attributes/VerifiedFiles/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithAllValuesOfNullableEnum.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== WithAllValuesOfNullableEnum ===
22

3-
BenchmarkDotNet=v0.10.x-mock, OS=Microsoft Windows NT 10.0.x.mock, VM=Hyper-V
3+
BenchmarkDotNet v0.10.x-mock, Microsoft Windows NT 10.0.x.mock (Hyper-V)
44
MockIntel Core i7-6700HQ CPU 2.60GHz (Max: 3.10GHz), 1 CPU, 8 logical and 4 physical cores
5-
Frequency=2531248 Hz, Resolution=395.0620 ns, Timer=TSC
5+
Frequency: 2531248 Hz, Resolution: 395.0620 ns, Timer: TSC
66
[Host] : Clr 4.0.x.mock, 64mock RyuJIT-v4.6.x.mock CONFIGURATION
77
DefaultJob : extra output line
88

tests/BenchmarkDotNet.Tests/Attributes/VerifiedFiles/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithNotAllowedFlagsEnumError.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== WithNotAllowedFlagsEnumError ===
22

3-
BenchmarkDotNet=v0.10.x-mock, OS=Microsoft Windows NT 10.0.x.mock, VM=Hyper-V
3+
BenchmarkDotNet v0.10.x-mock, Microsoft Windows NT 10.0.x.mock (Hyper-V)
44
MockIntel Core i7-6700HQ CPU 2.60GHz (Max: 3.10GHz), 1 CPU, 8 logical and 4 physical cores
5-
Frequency=2531248 Hz, Resolution=395.0620 ns, Timer=TSC
5+
Frequency: 2531248 Hz, Resolution: 395.0620 ns, Timer: TSC
66
[Host] : Clr 4.0.x.mock, 64mock RyuJIT-v4.6.x.mock CONFIGURATION
77
DefaultJob : extra output line
88

tests/BenchmarkDotNet.Tests/Attributes/VerifiedFiles/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithNotAllowedNullableTypeError.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== WithNotAllowedNullableTypeError ===
22

3-
BenchmarkDotNet=v0.10.x-mock, OS=Microsoft Windows NT 10.0.x.mock, VM=Hyper-V
3+
BenchmarkDotNet v0.10.x-mock, Microsoft Windows NT 10.0.x.mock (Hyper-V)
44
MockIntel Core i7-6700HQ CPU 2.60GHz (Max: 3.10GHz), 1 CPU, 8 logical and 4 physical cores
5-
Frequency=2531248 Hz, Resolution=395.0620 ns, Timer=TSC
5+
Frequency: 2531248 Hz, Resolution: 395.0620 ns, Timer: TSC
66
[Host] : Clr 4.0.x.mock, 64mock RyuJIT-v4.6.x.mock CONFIGURATION
77
DefaultJob : extra output line
88

tests/BenchmarkDotNet.Tests/Attributes/VerifiedFiles/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithNotAllowedTypeError.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== WithNotAllowedTypeError ===
22

3-
BenchmarkDotNet=v0.10.x-mock, OS=Microsoft Windows NT 10.0.x.mock, VM=Hyper-V
3+
BenchmarkDotNet v0.10.x-mock, Microsoft Windows NT 10.0.x.mock (Hyper-V)
44
MockIntel Core i7-6700HQ CPU 2.60GHz (Max: 3.10GHz), 1 CPU, 8 logical and 4 physical cores
5-
Frequency=2531248 Hz, Resolution=395.0620 ns, Timer=TSC
5+
Frequency: 2531248 Hz, Resolution: 395.0620 ns, Timer: TSC
66
[Host] : Clr 4.0.x.mock, 64mock RyuJIT-v4.6.x.mock CONFIGURATION
77
DefaultJob : extra output line
88

tests/BenchmarkDotNet.Tests/Environments/HostEnvironmentInfoTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public void ReturnsHypervisorNameWhenItsDetected(string hypervisorName)
2121

2222
string line = info.ToFormattedString().First();
2323

24-
string expected = $"{HostEnvironmentInfo.BenchmarkDotNetCaption}=v{info.BenchmarkDotNetVersion}, " +
25-
$"OS={info.OsVersion.Value}, VM={hypervisor.Name}";
24+
string expected = $"{HostEnvironmentInfo.BenchmarkDotNetCaption} v{info.BenchmarkDotNetVersion}, " +
25+
$"{info.OsVersion.Value} ({hypervisor.Name})";
2626
Assert.Equal(expected, line);
2727
}
2828

@@ -45,8 +45,8 @@ public void DoesntReturnHypervisorNameWhenItsNotDetected()
4545

4646
string line = info.ToFormattedString().First();
4747

48-
string expected = $"{HostEnvironmentInfo.BenchmarkDotNetCaption}=v{info.BenchmarkDotNetVersion}, " +
49-
$"OS={info.OsVersion.Value}";
48+
string expected = $"{HostEnvironmentInfo.BenchmarkDotNetCaption} v{info.BenchmarkDotNetVersion}, " +
49+
$"{info.OsVersion.Value}";
5050
Assert.Equal(expected, line);
5151
}
5252
}

0 commit comments

Comments
 (0)