mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-18 22:31:08 +08:00
78ed4b2077
One of several moves to make this something we can dev on all platforms and build on Actions for v3 onwards.
33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
using System.ComponentModel;
|
|
using System.Reflection;
|
|
using BenchmarkDotNet.Columns;
|
|
using BenchmarkDotNet.Reports;
|
|
using BenchmarkDotNet.Running;
|
|
|
|
namespace Dapper.Tests.Performance.Helpers
|
|
{
|
|
public class ORMColum : IColumn
|
|
{
|
|
public string Id => nameof(ORMColum);
|
|
public string ColumnName { get; } = "ORM";
|
|
public string Legend => "The object/relational mapper being tested";
|
|
|
|
public bool IsDefault(Summary summary, BenchmarkCase benchmarkCase) => false;
|
|
public string GetValue(Summary summary, BenchmarkCase benchmarkCase)
|
|
{
|
|
var type = benchmarkCase.Descriptor.WorkloadMethod.DeclaringType;
|
|
return type.GetCustomAttribute<DescriptionAttribute>()?.Description ?? type.Name.Replace("Benchmarks", string.Empty);
|
|
}
|
|
|
|
public string GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyle style) => GetValue(summary, benchmarkCase);
|
|
|
|
public bool IsAvailable(Summary summary) => true;
|
|
public bool AlwaysShow => true;
|
|
public ColumnCategory Category => ColumnCategory.Job;
|
|
public int PriorityInCategory => -10;
|
|
public bool IsNumeric => false;
|
|
public UnitType UnitType => UnitType.Dimensionless;
|
|
public override string ToString() => ColumnName;
|
|
}
|
|
}
|