Show / Hide Table of Contents

    Class BenchmarkSettings

    Settings for how a particular Benchmark should be run and executed.

    Inheritance
    System.Object
    BenchmarkSettings
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: NBench.Sdk
    Assembly: NBench.dll
    Syntax
    public class BenchmarkSettings

    Constructors

    BenchmarkSettings(TestMode, RunMode, Int32, Int32, IEnumerable<IBenchmarkSetting>, IReadOnlyDictionary<MetricName, MetricsCollectorSelector>)

    Declaration
    public BenchmarkSettings(TestMode testMode, RunMode runMode, int numberOfIterations, int runTime, IEnumerable<IBenchmarkSetting> benchmarkSettings, IReadOnlyDictionary<MetricName, MetricsCollectorSelector> collectors)
    Parameters
    Type Name Description
    TestMode testMode
    RunMode runMode
    System.Int32 numberOfIterations
    System.Int32 runTime
    System.Collections.Generic.IEnumerable<IBenchmarkSetting> benchmarkSettings
    System.Collections.Generic.IReadOnlyDictionary<MetricName, MetricsCollectorSelector> collectors

    BenchmarkSettings(TestMode, RunMode, Int32, Int32, IEnumerable<IBenchmarkSetting>, IReadOnlyDictionary<MetricName, MetricsCollectorSelector>, String, String, IBenchmarkTrace, Boolean)

    Declaration
    public BenchmarkSettings(TestMode testMode, RunMode runMode, int numberOfIterations, int runTimeMilliseconds, IEnumerable<IBenchmarkSetting> benchmarkSettings, IReadOnlyDictionary<MetricName, MetricsCollectorSelector> collectors, string description, string skip, IBenchmarkTrace trace, bool concurrencyModeEnabled = false)
    Parameters
    Type Name Description
    TestMode testMode
    RunMode runMode
    System.Int32 numberOfIterations
    System.Int32 runTimeMilliseconds
    System.Collections.Generic.IEnumerable<IBenchmarkSetting> benchmarkSettings
    System.Collections.Generic.IReadOnlyDictionary<MetricName, MetricsCollectorSelector> collectors
    System.String description
    System.String skip
    IBenchmarkTrace trace
    System.Boolean concurrencyModeEnabled

    Fields

    DefaultRuntimeMilliseconds

    Declaration
    public const long DefaultRuntimeMilliseconds = 1000L
    Field Value
    Type Description
    System.Int64

    Properties

    Collectors

    The table of collectors we're going to use to gather the metrics configured in Measurements

    Declaration
    public IReadOnlyDictionary<MetricName, MetricsCollectorSelector> Collectors { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<MetricName, MetricsCollectorSelector>

    ConcurrentMode

    Indicates whether concurrency is enabled or not

    Declaration
    public bool ConcurrentMode { get; }
    Property Value
    Type Description
    System.Boolean

    CounterMeasurements

    Counter settings, which require special treatment since they have to be injected into BenchmarkContext. Derived from DistinctMeasurements.

    Declaration
    public IEnumerable<CounterBenchmarkSetting> CounterMeasurements { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<CounterBenchmarkSetting>

    Description

    A description of this performance benchmark, which will be written into the report.

    Declaration
    public string Description { get; }
    Property Value
    Type Description
    System.String

    DistinctMeasurements

    If someone declares two measurements that measure the same thing, but carry different BenchmarkAssertions then those settings will only show up once on this list, whereas they might appear twice on Measurements

    Declaration
    public IReadOnlyList<IBenchmarkSetting> DistinctMeasurements { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<IBenchmarkSetting>

    Measurements

    All of the configured metrics for this Benchmark

    Declaration
    public IReadOnlyList<IBenchmarkSetting> Measurements { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<IBenchmarkSetting>

    NumberOfIterations

    Number of times this test will be run

    Declaration
    public int NumberOfIterations { get; }
    Property Value
    Type Description
    System.Int32
    Remarks

    Defaults to 10

    RunMode

    The mode in which the performance test will be executed.

    Declaration
    public RunMode RunMode { get; }
    Property Value
    Type Description
    RunMode

    RunTime

    Timeout the performance test and fail it if any individual run exceeds this value.

    Declaration
    public TimeSpan RunTime { get; }
    Property Value
    Type Description
    System.TimeSpan
    Remarks

    Set to 0 to disable.

    Skip

    If populated, this benchmark will be skipped and the skip reason will be written into the report.

    Declaration
    public string Skip { get; }
    Property Value
    Type Description
    System.String

    SkipWarmups

    Indicates whether or not we will skip warmups for our benchmarks

    Declaration
    public bool SkipWarmups { get; set; }
    Property Value
    Type Description
    System.Boolean

    TestMode

    Declaration
    public TestMode TestMode { get; }
    Property Value
    Type Description
    TestMode

    TotalTrackedMetrics

    Total number of all metrics tracked in this benchmark

    Declaration
    public int TotalTrackedMetrics { get; }
    Property Value
    Type Description
    System.Int32

    Trace

    The IBenchmarkTrace implementation we will use for each BenchmarkRun

    Declaration
    public IBenchmarkTrace Trace { get; }
    Property Value
    Type Description
    IBenchmarkTrace

    TracingEnabled

    Indicates whether tracing is enabled or not

    Declaration
    public bool TracingEnabled { get; }
    Property Value
    Type Description
    System.Boolean
    Back to top Copyright © 2015-2020 Petabridge™, LLC