Interface IMeasurementConfigurator<T>
Interface used to configure MeasurementAttributes implemented in both built-in NBench libraries and external libraries.
Inherited Members
Namespace: NBench.Sdk
Assembly: NBench.dll
Syntax
public interface IMeasurementConfigurator<in T> : IMeasurementConfigurator where T : MeasurementAttribute
Type Parameters
Name | Description |
---|---|
T | The type of measurement supported by this configurator |
Methods
GetBenchmarkSettings(T)
Produce a IBenchmarkSetting implementation that will be used to tell the Benchmark class which Assertion, if any, it should perform against the MetricCollector data produced for this setting by the GetMetricsProvider(MeasurementAttribute) method on this configurator.
Declaration
IEnumerable<IBenchmarkSetting> GetBenchmarkSettings(T instance)
Parameters
Type | Name | Description |
---|---|---|
T | instance | An instance of the MeasurementAttribute type that corresponds to this configurator.
Must not be |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IBenchmarkSetting> | An IBenchmarkSetting implementation instance built specifically for |
GetMetricsProvider(T)
Produce a MetricsCollectorSelector implementation based on the provided MeasurementAttribute instance.
Declaration
MetricsCollectorSelector GetMetricsProvider(T instance)
Parameters
Type | Name | Description |
---|---|---|
T | instance | An instance of the MeasurementAttribute type that corresponds to this configurator.
Must not be |
Returns
Type | Description |
---|---|
MetricsCollectorSelector | A MetricsCollectorSelector implementation corresponding to this metric. |
Remarks
This object basically tells NBench how to gather the metrics associated with the MeasurementAttribute
GetName(T)
Produce a MetricName implementation based on the provided MeasurementAttribute instance.
Declaration
MetricName GetName(T instance)
Parameters
Type | Name | Description |
---|---|---|
T | instance | An instance of the MeasurementAttribute type that corresponds to this configurator.
Must not be |
Returns
Type | Description |
---|---|
MetricName | A MetricName implementation corresponding to this metric. |