-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Feature Request: Add ability to automatically hide metric columns if value is not set #2673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
314f8f2
Hide the columns described in the issue & add samples for test
AvishaiDotan 56b261e
Polish sample names
AvishaiDotan 08ce0de
remove irrelevant commit from pr
AvishaiDotan 26cea27
remove leftovers
AvishaiDotan 9bd6d51
Added some helper classes to inject the configuration into the descri…
AvishaiDotan a9d767a
Merge branch 'dotnet:master' into master
AvishaiDotan b613aa2
Merged branch-1 into branch-2-with-branch-1-changes with adjustments
AvishaiDotan 67f6db9
change the injection of configuration
AvishaiDotan 7486aea
merge with master
AvishaiDotan 33dc4d5
Merge branch 'master' of https://github.com/AvishaiDotan/BenchmarkDotNet
AvishaiDotan 90cc144
add tests
AvishaiDotan c7a5502
return the singleton pattern
AvishaiDotan 3e1b333
change private descriptors into internal
AvishaiDotan 4629daf
remove DescriptorConfigInjector
AvishaiDotan b504b21
remove samples
AvishaiDotan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
samples/BenchmarkDotNet.Samples/IntroExceptionDiagnoserAfterHideColumns.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| using BenchmarkDotNet.Attributes; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace BenchmarkDotNet.Samples | ||
| { | ||
| [ExceptionDiagnoser] | ||
| public class IntroExceptionDiagnoserAfterHideColumns | ||
| { | ||
| [Benchmark] | ||
| public void Benchmark() | ||
| { | ||
| Thread.Sleep(1); | ||
| } | ||
|
|
||
| [Benchmark] public void NoThrow() { } | ||
| [Benchmark] | ||
| public void Throw() | ||
| { | ||
| //try { throw new Exception(); } catch { } | ||
| } | ||
| } | ||
| } |
20 changes: 20 additions & 0 deletions
20
samples/BenchmarkDotNet.Samples/IntroThreadingDiagnoserAfterHideColumns.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using BenchmarkDotNet.Attributes; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace BenchmarkDotNet.Samples | ||
| { | ||
| [ThreadingDiagnoser(false, false)] | ||
| public class IntroThreadingDiagnoserAfterHideColumns | ||
| { | ||
| [Benchmark] | ||
| public void Benchmark() | ||
| { | ||
| Thread.Sleep(1); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/BenchmarkDotNet/Attributes/ExceptionDiagnoserConfig.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using JetBrains.Annotations; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace BenchmarkDotNet.Attributes | ||
| { | ||
| public class ExceptionDiagnoserConfig | ||
| { | ||
| /// <param name="displayExceptionsIfZeroValue">Determines whether the Exceptions column is displayed when its value is not calculated. True by default.</param> | ||
|
|
||
| [PublicAPI] | ||
| public ExceptionDiagnoserConfig(bool displayExceptionsIfZeroValue = true) | ||
| { | ||
| DisplayExceptionsIfZeroValue = displayExceptionsIfZeroValue; | ||
| } | ||
|
|
||
| public bool DisplayExceptionsIfZeroValue { get; } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/BenchmarkDotNet/Diagnosers/ThreadingDiagnoserConfig.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using JetBrains.Annotations; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace BenchmarkDotNet.Diagnosers | ||
| { | ||
| public class ThreadingDiagnoserConfig | ||
| { | ||
| /// <param name="displayLockContentionWhenZero">Display configuration for 'LockContentionCount' when it is empty. True (displayed) by default.</param> | ||
| /// <param name="displayCompletedWorkItemCountWhenZero">Display configuration for 'CompletedWorkItemCount' when it is empty. True (displayed) by default.</param> | ||
|
|
||
| [PublicAPI] | ||
| public ThreadingDiagnoserConfig(bool displayLockContentionWhenZero = true, bool displayCompletedWorkItemCountWhenZero = true) | ||
| { | ||
| DisplayLockContentionWhenZero = displayLockContentionWhenZero; | ||
| DisplayCompletedWorkItemCountWhenZero = displayCompletedWorkItemCountWhenZero; | ||
| } | ||
|
|
||
| public bool DisplayLockContentionWhenZero { get; } | ||
| public bool DisplayCompletedWorkItemCountWhenZero { get; } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.