File tree 9 files changed +144
-1
lines changed
samples/BenchmarkDotNet.Samples
9 files changed +144
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ uid : docs.hidingcolumns
3
+ name : Hide columns
4
+ ---
5
+
6
+ # Hiding Columns
7
+
8
+ You can hide columns in a table in the following ways:
9
+
10
+ ---
11
+
12
+ [ !include[ IntroHideColumnsAttr] ( ../samples/IntroHideColumnsAttr.md )]
13
+
14
+ [ !include[ IntroHideColumnsConfig] ( ../samples/IntroHideColumnsConfig.md )]
15
+
16
+ [ !include[ IntroHideColumnsCustomRule] ( ../samples/IntroHideColumnsCustomRule.md )]
Original file line number Diff line number Diff line change 21
21
- name : Orderers
22
22
href : orderers.md
23
23
- name : ConfigOptions
24
- href : configoptions.md
24
+ href : configoptions.md
25
+ - name : Hiding Columns
26
+ href : hidingcolumns.md
Original file line number Diff line number Diff line change
1
+ ---
2
+ uid : BenchmarkDotNet.Samples.IntroHideColumnsAttr
3
+ ---
4
+
5
+ ## Sample: IntroHideColumnsAttr
6
+
7
+ ### Source code
8
+
9
+ [ !code-csharp[ IntroHideColumnsAttr.cs] ( ../../../samples/BenchmarkDotNet.Samples/IntroHideColumnsAttr.cs )]
10
+
11
+ ### Links
12
+
13
+ * @docs .hidingcolumns
14
+ * The permanent link to this sample: @BenchmarkDotNet .Samples.IntroHideColumnsAttr
15
+
16
+ ---
Original file line number Diff line number Diff line change
1
+ ---
2
+ uid : BenchmarkDotNet.Samples.IntroHideColumnsConfig
3
+ ---
4
+
5
+ ## Sample: IntroHideColumnsConfig
6
+
7
+ ### Source code
8
+
9
+ [ !code-csharp[ IntroHideColumnsConfig.cs] ( ../../../samples/BenchmarkDotNet.Samples/IntroHideColumnsConfig.cs )]
10
+
11
+ ### Links
12
+
13
+ * @docs .hidingcolumns
14
+ * The permanent link to this sample: @BenchmarkDotNet .Samples.IntroHideColumnsConfig
15
+
16
+ ---
Original file line number Diff line number Diff line change
1
+ ---
2
+ uid : BenchmarkDotNet.Samples.IntroHideColumnsCustomRule
3
+ ---
4
+
5
+ ## Sample: IntroHideColumnsCustomRule
6
+
7
+ ### Source code
8
+
9
+ [ !code-csharp[ IntroHideColumnsCustomRule.cs] ( ../../../samples/BenchmarkDotNet.Samples/IntroHideColumnsCustomRule.cs )]
10
+
11
+ ### Links
12
+
13
+ * @docs .hidingcolumns
14
+ * The permanent link to this sample: @BenchmarkDotNet .Samples.IntroHideColumnsCustomRule
15
+
16
+ ---
Original file line number Diff line number Diff line change 54
54
href : IntroGenericTypeArguments.md
55
55
- name : IntroHardwareCounters
56
56
href : IntroHardwareCounters.md
57
+ - name : IntroHideColumnsAttr
58
+ href : IntroHideColumnsAttr.md
59
+ - name : IntroHideColumnsConfig
60
+ href : IntroHideColumnsConfig.md
61
+ - name : IntroHideColumnsCustomRule
62
+ href : IntroHideColumnsCustomRule.md
57
63
- name : IntroInliningDiagnoser
58
64
href : IntroInliningDiagnoser.md
59
65
- name : IntroInProcess
Original file line number Diff line number Diff line change
1
+ using BenchmarkDotNet . Attributes ;
2
+ using BenchmarkDotNet . Rules ;
3
+
4
+ namespace BenchmarkDotNet . Samples
5
+ {
6
+ [ HideColumns ( Column . Mean , Column . Error ) ]
7
+ [ HideColumns ( "StdDev" , "N" ) ]
8
+ public class IntroHideColumns
9
+ {
10
+ [ Params ( 1 , 2 ) ] public int N ;
11
+
12
+ [ Benchmark ]
13
+ public void Test ( ) { }
14
+ }
15
+ }
Original file line number Diff line number Diff line change
1
+ using BenchmarkDotNet . Attributes ;
2
+ using BenchmarkDotNet . Columns ;
3
+ using BenchmarkDotNet . Configs ;
4
+ using BenchmarkDotNet . Rules ;
5
+ using BenchmarkDotNet . Running ;
6
+
7
+ namespace BenchmarkDotNet . Samples
8
+ {
9
+ public class IntroHideColumnsFluentConfig
10
+ {
11
+ public static void Run ( )
12
+ {
13
+ BenchmarkRunner . Run < Benchmark > (
14
+ DefaultConfig . Instance
15
+ . HideColumns ( Column . Mean , Column . Error )
16
+ . HideColumns ( "StdDev" , "N" ) ) ;
17
+ }
18
+
19
+ public class Benchmark
20
+ {
21
+ [ Params ( 1 , 2 ) ] public int N ;
22
+
23
+ [ Benchmark ]
24
+ public void Test ( ) { }
25
+ }
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ using BenchmarkDotNet . Attributes ;
2
+ using BenchmarkDotNet . Columns ;
3
+ using BenchmarkDotNet . Configs ;
4
+ using BenchmarkDotNet . Rules ;
5
+ using BenchmarkDotNet . Running ;
6
+
7
+ namespace BenchmarkDotNet . Samples
8
+ {
9
+ public class StatisticColumnHidingRule : IColumnHidingRule
10
+ {
11
+ public bool NeedToHide ( IColumn column ) => column . Category == ColumnCategory . Statistics ;
12
+ }
13
+
14
+ public class IntroHideColumnsByCustomRule
15
+ {
16
+ public static void Run ( )
17
+ {
18
+ BenchmarkRunner . Run < Benchmark > (
19
+ DefaultConfig . Instance . HideColumns ( new StatisticColumnHidingRule ( ) ) ) ;
20
+ }
21
+
22
+ [ AllStatisticsColumn ]
23
+ public class Benchmark
24
+ {
25
+ [ Benchmark ]
26
+ public void Test ( ) { }
27
+ }
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments