BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

Feature Request: Add ability to automatically hide metric columns if value is not set

Open filzrev opened this issue 1 year ago • 1 comments
trafficstars

When using ThreadingDiagnoser/ExceptionDiagnoser. Following metric columns are displayed always .

  • Exceptions
  • Completed Work Items
  • Lock Contentions

Is it able to automatically hide these columns if all metric values are 0 ?.

It seems to be able to change behaviors by modifying following code.

Excample benchmark code

 [ShortRunJob]
 [ThreadingDiagnoser]
 // [HideColumns(Column.CompletedWorkItems, Column.LockContentions, Column.Exceptions)]
 public class Benchmarks
 {
     [Benchmark]
     public void Benchmark()
     {
         Thread.Sleep(1);
     }
 }

Console Output

| Method    | Mean     | Error    | StdDev   | Exceptions | Completed Work Items | Lock Contentions |
|---------- |---------:|---------:|---------:|-----------:|---------------------:|-----------------:|
| Benchmark | 15.57 ms | 0.364 ms | 0.020 ms |          - |                    - |                - |

filzrev avatar Aug 31 '24 14:08 filzrev