diff --git a/src/BenchmarkDotNet/Columns/JobCharacteristicColumn.cs b/src/BenchmarkDotNet/Columns/JobCharacteristicColumn.cs index 74f7b2b8ba..77c4cbc7a5 100644 --- a/src/BenchmarkDotNet/Columns/JobCharacteristicColumn.cs +++ b/src/BenchmarkDotNet/Columns/JobCharacteristicColumn.cs @@ -28,7 +28,6 @@ private JobCharacteristicColumn(Characteristic characteristic) public string Id { get; } public string ColumnName { get; } - public bool IsAvailable(Summary summary) => true; public bool AlwaysShow => false; public ColumnCategory Category => ColumnCategory.Job; public int PriorityInCategory => 0; @@ -38,6 +37,23 @@ private JobCharacteristicColumn(Characteristic characteristic) public bool IsDefault(Summary summary, BenchmarkCase benchmarkCase) => !benchmarkCase.Job.HasValue(characteristic); + public bool IsAvailable(Summary summary) + { + if (summary.IsMultipleRuntimes) + { + if (nameof(Toolchains.Toolchain).Equals(ColumnName)) + { + return false; + } + if (nameof(Job).Equals(ColumnName)) + { + return summary.BenchmarksCases.Any(x => x.Job.HasValue(CharacteristicObject.IdCharacteristic)); + } + } + + return true; + } + public string GetValue(Summary summary, BenchmarkCase benchmarkCase) { if (!benchmarkCase.Job.HasValue(characteristic) && EnvironmentResolver.Instance.CanResolve(characteristic)) diff --git a/src/BenchmarkDotNet/Reports/Summary.cs b/src/BenchmarkDotNet/Reports/Summary.cs index 87e96695eb..85e066b163 100644 --- a/src/BenchmarkDotNet/Reports/Summary.cs +++ b/src/BenchmarkDotNet/Reports/Summary.cs @@ -30,11 +30,12 @@ public class Summary [PublicAPI] public ImmutableArray BenchmarksCases { get; } [PublicAPI] public ImmutableArray Reports { get; } - private ImmutableDictionary ReportMap {get; } - private BaseliningStrategy BaseliningStrategy {get; } - internal DisplayPrecisionManager DisplayPrecisionManager { get; } + private ImmutableDictionary ReportMap { get; } + private BaseliningStrategy BaseliningStrategy { get; } + private bool? isMultipleRuntimes; + public Summary( string title, ImmutableArray reports, @@ -75,6 +76,9 @@ public Summary( public int GetNumberOfExecutedBenchmarks() => Reports.Count(report => report.ExecuteResults.Any(result => result.FoundExecutable)); + public bool IsMultipleRuntimes + => isMultipleRuntimes ??= BenchmarksCases.Length > 1 ? BenchmarksCases.Select(benchmark => benchmark.GetRuntime()).Distinct().Count() > 1 : false; + internal static Summary NothingToRun(string title, string resultsDirectoryPath, string logFilePath) => new Summary(title, ImmutableArray.Empty, HostEnvironmentInfo.GetCurrent(), resultsDirectoryPath, logFilePath, TimeSpan.Zero, DefaultCultureInfo.Instance, ImmutableArray.Empty);