Class RecyclableParamsColumnProvider
An alternative to DefaultColumnProviders.Params that displays parameters in recyclable columns corresponding to parameter position rather than name.
Implements
Namespace: Mawosoft.Extensions.BenchmarkDotNet
Assembly: Mawosoft.Extensions.BenchmarkDotNet.dll
Syntax
public class RecyclableParamsColumnProvider : Object
Constructors
RecyclableParamsColumnProvider(Boolean, String)
Initializes a new instance of the RecyclableParamsColumnProvider class.
Declaration
public RecyclableParamsColumnProvider(bool tryKeepParamName = true, string genericName = "Param")
Parameters
Type | Name | Description |
---|---|---|
Boolean | tryKeepParamName | If |
String | genericName | Prefix for the generic, numbered column header. The default is |
Examples
Use AddColumnProvider() if you are building a config from scratch.
ManualConfig config = ManualConfig.CreateEmpty()
// Add the DefaultColumnProviders you need except DefaultColumnProviders.Params
.AddColumnProvider(DefaultColumnProviders.Descriptor /* add more... */)
// Add a new RecyclableParamsColumnProvider
.AddColumnProvider(new RecyclableParamsColumnProvider());
// Add other elements to the config...
If you are modifying an existing config, use ReplaceColumnCategory(), one of the new config extension methods in this library.
ManualConfig config = ManualConfig.Create(DefaultConfig.Instance)
// Replace the default param columns with a new RecyclableParamsColumnProvider
.ReplaceColumnCategory(new RecyclableParamsColumnProvider());
// Make other changes to the config...
Sample Output
// with RecyclableParamsColumnProvider() // default settings Job=Dry Toolchain=InProcessEmitToolchain IterationCount=1 LaunchCount=1 RunStrategy=ColdStart UnrollFactor=1 WarmupCount=1 | Method | fooArg | Param2 | Mean | Error | |-------- |-------- |--------- |---------:|------:| | Method1 | fooval1 | barval1 | 244.4 μs | NA | | Method2 | fooval1 | bazval1 | 223.3 μs | NA | | Method3 | fooval1 | buzzval1 | 238.0 μs | NA | | Method1 | fooval2 | barval2 | 329.4 μs | NA | | Method2 | fooval2 | bazval2 | 209.0 μs | NA | | Method3 | fooval2 | buzzval2 | 238.0 μs | NA | fooArg : Value of the 'fooArg' parameter Param2 : Value of the parameter at position 2 Mean : Arithmetic mean of all measurements Error : Half of 99.9% confidence interval 1 μs : 1 Microsecond (0.000001 sec)
See Also
Methods
GetColumns(Summary)
IColumnProvider implementation.
Declaration
public IEnumerable<IColumn> GetColumns(Summary summary)
Parameters
Type | Name | Description |
---|---|---|
Summary | summary |
Returns
Type | Description |
---|---|
IEnumerable<IColumn> |