Skip to content

Commit

Permalink
Fix manual config setup
Browse files Browse the repository at this point in the history
Minimal config is now used as the base, therefore no columns are defined twice
  • Loading branch information
JohannesDeml committed Apr 4, 2023
1 parent 13a5043 commit b8e4547
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class ConfigHelper
/// * units stay the same
/// * No units in cell data (Always numbers)
/// </summary>
public static readonly SummaryStyle CsvStyle = new SummaryStyle(CultureInfo.InvariantCulture, false, SizeUnit.KB, TimeUnit.Millisecond,
private static readonly SummaryStyle CsvStyle = new SummaryStyle(CultureInfo.InvariantCulture, false, SizeUnit.KB, TimeUnit.Millisecond,
false, true, 100);

public static void AddDefaultColumns(ManualConfig config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public class PerformanceBenchmarkConfig : ManualConfig
{
public PerformanceBenchmarkConfig()
{
Add(DefaultConfig.Instance);

Job baseJob = Job.Default
.WithLaunchCount(1)
.WithWarmupCount(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public class QuickBenchmarkConfig : ManualConfig
{
public QuickBenchmarkConfig()
{
Add(DefaultConfig.Instance);

Job baseJob = Job.Default
.WithStrategy(RunStrategy.Monitoring)
.WithLaunchCount(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public class SamplingBenchmarkConfig : ManualConfig
{
public SamplingBenchmarkConfig()
{
Add(DefaultConfig.Instance);

Job baseJob = Job.Default
.WithLaunchCount(1)
.WithWarmupCount(1)
Expand Down
4 changes: 3 additions & 1 deletion NetworkBenchmarkDotNet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.CommandLine;
using System.CommandLine.Invocation;
using System.Linq;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;

Expand Down Expand Up @@ -103,7 +104,8 @@ private static void RunCustomBenchmark()
/// <typeparam name="T">Type of the benchmark to run</typeparam>
private static void RunBenchmark<T>()
{
var summary = BenchmarkRunner.Run<T>();
ManualConfig config = ManualConfig.CreateMinimumViable();
var summary = BenchmarkRunner.Run<T>(config);

Assert(!summary.HasCriticalValidationErrors, "The \"Summary\" should have NOT \"HasCriticalValidationErrors\"");

Expand Down

0 comments on commit b8e4547

Please sign in to comment.