Class CombinedParamsColumn
An alternative to DefaultColumnProviders.Params that displays all parameters in a single, customizable column.
Implements
Namespace: Mawosoft.Extensions.BenchmarkDotNet
Assembly: Mawosoft.Extensions.BenchmarkDotNet.dll
Syntax
public class CombinedParamsColumn : Object
Constructors
CombinedParamsColumn(String, String, String, String)
Initializes a new instance of the CombinedParamsColumn class with optional custom formatting.
Declaration
public CombinedParamsColumn(string formatNameValue = "{0}={1}", string separator = ", ", string prefix = "", string suffix = "")
Parameters
Type | Name | Description |
---|---|---|
String | formatNameValue | A composite format string where the format item The default is |
String | separator | The string to use as a separator between multiple formatted parameters. The default is |
String | prefix | The string to use before the first formatted parameter. The default is an empty string. |
String | suffix | The string to use after the last formatted parameter. The default is an empty string. |
Examples
Use AddColumn() 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 CombinedParamsColumn
.AddColumn(new CombinedParamsColumn());
// 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 CombinedParamsColumn
.ReplaceColumnCategory(new CombinedParamsColumn());
// Make other changes to the config...
Change the formatting to display values only, separated by semicolon.
new CombinedParamsColumn("{1}", "; ")
Sample Output
// with CombinedParamsColumn() // default formatting Job=Dry Toolchain=InProcessEmitToolchain IterationCount=1 LaunchCount=1 RunStrategy=ColdStart UnrollFactor=1 WarmupCount=1 | Method | Params | Mean | Error | |-------- |--------------------------------- |---------:|------:| | Method1 | fooArg=fooval1, barArg=barval1 | 382.9 μs | NA | | Method2 | fooArg=fooval1, bazArg=bazval1 | 255.3 μs | NA | | Method3 | fooArg=fooval1, buzzArg=buzzval1 | 255.8 μs | NA | | Method1 | fooArg=fooval2, barArg=barval2 | 262.6 μs | NA | | Method2 | fooArg=fooval2, bazArg=bazval2 | 268.5 μs | NA | | Method3 | fooArg=fooval2, buzzArg=buzzval2 | 256.6 μs | NA | Params : All parameter values Mean : Arithmetic mean of all measurements Error : Half of 99.9% confidence interval 1 μs : 1 Microsecond (0.000001 sec)
See Also
Properties
AlwaysShow
IColumn implementation.
Declaration
public bool AlwaysShow { get; }
Property Value
Type | Description |
---|---|
Boolean |
Category
IColumn implementation.
Declaration
public ColumnCategory Category { get; }
Property Value
Type | Description |
---|---|
ColumnCategory |
ColumnName
IColumn implementation.
Declaration
public string ColumnName { get; }
Property Value
Type | Description |
---|---|
String |
Id
IColumn implementation.
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
String |
IsNumeric
IColumn implementation.
Declaration
public bool IsNumeric { get; }
Property Value
Type | Description |
---|---|
Boolean |
Legend
IColumn implementation.
Declaration
public string Legend { get; }
Property Value
Type | Description |
---|---|
String |
PriorityInCategory
IColumn implementation.
Declaration
public int PriorityInCategory { get; }
Property Value
Type | Description |
---|---|
Int32 |
UnitType
IColumn implementation.
Declaration
public UnitType UnitType { get; }
Property Value
Type | Description |
---|---|
UnitType |
Methods
GetValue(Summary, BenchmarkCase)
IColumn implementation.
Declaration
public string GetValue(Summary summary, BenchmarkCase benchmarkCase)
Parameters
Type | Name | Description |
---|---|---|
Summary | summary | |
BenchmarkCase | benchmarkCase |
Returns
Type | Description |
---|---|
String |
GetValue(Summary, BenchmarkCase, SummaryStyle)
IColumn implementation.
Declaration
public string GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyle style)
Parameters
Type | Name | Description |
---|---|---|
Summary | summary | |
BenchmarkCase | benchmarkCase | |
SummaryStyle | style |
Returns
Type | Description |
---|---|
String |
IsAvailable(Summary)
IColumn implementation.
Declaration
public bool IsAvailable(Summary summary)
Parameters
Type | Name | Description |
---|---|---|
Summary | summary |
Returns
Type | Description |
---|---|
Boolean |
IsDefault(Summary, BenchmarkCase)
IColumn implementation.
Declaration
public bool IsDefault(Summary summary, BenchmarkCase benchmarkCase)
Parameters
Type | Name | Description |
---|---|---|
Summary | summary | |
BenchmarkCase | benchmarkCase |
Returns
Type | Description |
---|---|
Boolean |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |