Class MeasurementConfigurator<T>
Used by ReflectionDiscovery to provide all of the necessary components needed to create usable settings needed to instrument developer-defined MeasurementAttributes.
Inheritance
Inherited Members
Namespace: NBench.Sdk
Assembly: NBench.dll
Syntax
public abstract class MeasurementConfigurator<T> : IMeasurementConfigurator<T>, IMeasurementConfigurator where T : MeasurementAttribute
Type Parameters
| Name | Description |
|---|---|
| T | The type of MeasurementAttribute configured by this class. |
Properties
MeasurementType
The type of the underlying MeasurementAttribute configured by this MeasurementConfigurator<T>
Declaration
public Type MeasurementType { get; }
Property Value
| Type | Description |
|---|---|
| System.Type |
MeasurementTypeInfo
System.Reflection.TypeInfo extracted from MeasurementType; cached to save on frequent lookups.
Declaration
public TypeInfo MeasurementTypeInfo { get; }
Property Value
| Type | Description |
|---|---|
| System.Reflection.TypeInfo |
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
public abstract 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> | IBenchmarkSetting implementation instances built specifically for T |
GetBenchmarkSettings(MeasurementAttribute)
Declaration
public IEnumerable<IBenchmarkSetting> GetBenchmarkSettings(MeasurementAttribute instance)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementAttribute | instance |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IBenchmarkSetting> |
GetMetricsProvider(T)
Produce a MetricsCollectorSelector implementation based on the provided MeasurementAttribute instance.
Declaration
public abstract 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
GetMetricsProvider(MeasurementAttribute)
Declaration
public MetricsCollectorSelector GetMetricsProvider(MeasurementAttribute instance)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementAttribute | instance |
Returns
| Type | Description |
|---|---|
| MetricsCollectorSelector |
GetName(T)
Produce a MetricName implementation based on the provided MeasurementAttribute instance.
Declaration
public abstract 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. |