Class PerfBenchmarkAttribute
Marks a method on a class as being an NBench performance test
Inheritance
System.Object
System.Attribute
PerfBenchmarkAttribute
Inherited Members
System.Attribute.Equals(System.Object)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetHashCode()
System.Attribute.IsDefaultAttribute()
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.Match(System.Object)
System.Attribute.TypeId
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: NBench.dll
Syntax
[AttributeUsage(AttributeTargets.Method)]
public class PerfBenchmarkAttribute : Attribute
Constructors
PerfBenchmarkAttribute()
Declaration
public PerfBenchmarkAttribute()
Fields
DefaultNumberOfIterations
Declaration
public const int DefaultNumberOfIterations = 10
Field Value
| Type |
Description |
| System.Int32 |
|
DefaultRuntimeMilliseconds
Declaration
public const int DefaultRuntimeMilliseconds = 0
Field Value
| Type |
Description |
| System.Int32 |
|
DefaultRunType
Declaration
public const RunMode DefaultRunType = RunMode.Iterations
Field Value
DefaultTestType
Declaration
public const TestMode DefaultTestType = TestMode.Measurement
Field Value
Properties
Description
A description of this performance benchmark, which will be written into the report.
Declaration
public string Description { get; set; }
Property Value
| Type |
Description |
| System.String |
|
NumberOfIterations
Number of times this test will be run
Declaration
public int NumberOfIterations { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
RunMode
The mode in which this performance data will be collected.
Defaults to Iterations
Declaration
public RunMode RunMode { get; set; }
Property Value
RunTimeMilliseconds
For Throughput tests, this determines
the maximum amount of clock-time in milliseconds this benchmark will run.
For all other modes, this sets the timeout at which point the test will be failed.
Disabled by default in any tests using any mode other than Throughput.
Defaults to 1000ms in Throughput.
Declaration
public int RunTimeMilliseconds { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Skip
If populated, this benchmark will be skipped and the skip reason will be written into the report.
Declaration
public string Skip { get; set; }
Property Value
| Type |
Description |
| System.String |
|
SkipWarmups
Skips warmups (aside from the pre-warmup) entirely
Declaration
public bool SkipWarmups { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
TestMode
The mode in which this performance data will be tested.
Defaults to Measurement
Declaration
public TestMode TestMode { get; set; }
Property Value