Skip to content

Commit

Permalink
Replace AllocRatio ctor creation to the static field, like BaselineRa…
Browse files Browse the repository at this point in the history
…tioColumn.RatioMean
  • Loading branch information
YegorStepanov committed Jan 12, 2022
1 parent 2966336 commit 5bac031
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/BenchmarkDotNet/Columns/BaselineAllocationRatioColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public class BaselineAllocationRatioColumn : BaselineCustomColumn
public override string Id => nameof(BaselineAllocationRatioColumn);
public override string ColumnName => Column.AllocRatio;

public static readonly IColumn RatioMean = new BaselineAllocationRatioColumn();

private BaselineAllocationRatioColumn() { }

public override string GetValue(Summary summary, BenchmarkCase benchmarkCase, Statistics baseline, IReadOnlyDictionary<string, Metric> baselineMetrics,
Statistics current, IReadOnlyDictionary<string, Metric> currentMetrics, bool isBaseline)
{
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Columns/DefaultColumnProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public IEnumerable<IColumn> GetColumns(Summary summary)

if (HasMemoryDiagnoser(summary))
{
yield return new BaselineAllocationRatioColumn();
yield return BaselineAllocationRatioColumn.RatioMean;
}
}
}
Expand Down

0 comments on commit 5bac031

Please sign in to comment.