-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various adjustments to produce results in the format required for the PowerBI perflab platform.
- Loading branch information
Showing
6 changed files
with
84 additions
and
42 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using BenchmarkDotNet.Columns; | ||
using BenchmarkDotNet.Reports; | ||
using BenchmarkDotNet.Running; | ||
|
||
namespace BenchmarkDotNet.Attributes | ||
{ | ||
// Used to generate a single BDN output column combining all the parameters. | ||
// Required by the perflab's PowerBI setup. | ||
public class ParamsSummaryColumn : IColumn | ||
{ | ||
public string Id => nameof(ParamsSummaryColumn); | ||
public string ColumnName { get; } = "Params"; | ||
public bool IsDefault(Summary summary, BenchmarkCase benchmark) => false; | ||
public string GetValue(Summary summary, BenchmarkCase benchmark) => benchmark.Parameters.DisplayInfo; | ||
public bool IsAvailable(Summary summary) => true; | ||
public bool AlwaysShow => true; | ||
public ColumnCategory Category => ColumnCategory.Params; | ||
public int PriorityInCategory => 0; | ||
public override string ToString() => ColumnName; | ||
public bool IsNumeric => false; | ||
public UnitType UnitType => UnitType.Dimensionless; | ||
public string GetValue(Summary summary, BenchmarkCase benchmark, ISummaryStyle style) => GetValue(summary, benchmark); | ||
public string Legend => $"Summary of all parameter values"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Linq; | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Columns; | ||
using BenchmarkDotNet.Configs; | ||
using BenchmarkDotNet.Diagnosers; | ||
using BenchmarkDotNet.Exporters; | ||
using BenchmarkDotNet.Exporters.Csv; | ||
using BenchmarkDotNet.Horology; | ||
using BenchmarkDotNet.Reports; | ||
using BenchmarkDotNet.Running; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Benchmarks | ||
{ | ||
public static class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var config = DefaultConfig.Instance | ||
.With(DefaultConfig.Instance.GetDiagnosers().Concat(new[] { MemoryDiagnoser.Default }).ToArray()); | ||
|
||
var index = Array.FindIndex(args, s => s == "--perflab"); | ||
if (index >= 0) | ||
{ | ||
var argList = args.ToList(); | ||
argList.RemoveAt(index); | ||
args = argList.ToArray(); | ||
|
||
config = config | ||
.With(new[] | ||
{ | ||
StatisticColumn.OperationsPerSecond, | ||
new ParamsSummaryColumn() | ||
}) | ||
.With(new[] | ||
{ | ||
MarkdownExporter.GitHub, | ||
new CsvExporter( | ||
CsvSeparator.Comma, | ||
new SummaryStyle | ||
{ | ||
PrintUnitsInHeader = true, | ||
PrintUnitsInContent = false, | ||
TimeUnit = TimeUnit.Microsecond, | ||
SizeUnit = SizeUnit.KB | ||
}) | ||
}); | ||
} | ||
|
||
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config); | ||
} | ||
} | ||
} |