Skip to content
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

Auto-hide feature added for columns via Exception and Threading diagnoser configuration #2658

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Unreal11
Copy link

@Unreal11 Unreal11 commented Oct 23, 2024

Closes #2629

@Unreal11
Copy link
Author

@dotnet-policy-service agree

@timcassell
Copy link
Collaborator

timcassell commented Oct 23, 2024

What if one benchmark has zero value and another has non-zero value?

[Benchmark] public void NoThrow() { }
[Benchmark] public void Throw()
{
    try { throw new Exception(); } catch { }
}

May need new acceptance tests to validate the table output.

@Unreal11
Copy link
Author

What if one benchmark has zero value and another has non-zero value?

[Benchmark] public void NoThrow() { }
[Benchmark] public void Throw()
{
    try { throw new Exception(); } catch { }
}

May need new acceptance tests to validate the table output.

What behavior do we expect in this case? Something like that? Removed other colums for better readability

Method Exceptions
NoThrow -
Throw 1.0000

@Unreal11 Unreal11 marked this pull request as draft October 24, 2024 07:41
@timcassell
Copy link
Collaborator

What behavior do we expect in this case? Something like that? Removed other colums for better readability

Method Exceptions
NoThrow -
Throw 1.0000

Yes, that looks like what I would expect. I think with the current code it will display ? instead of - if you configure it to not display zero.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the sample needs to change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's draft, sorry) Just tested new output

@Unreal11
Copy link
Author

What behavior do we expect in this case? Something like that? Removed other colums for better readability
Method Exceptions
NoThrow -
Throw 1.0000

Yes, that looks like what I would expect. I think with the current code it will display ? instead of - if you configure it to not display zero.

At the moment it displays 'NA' instead of '-' if its configured to not display zero. Is it acceptable? And is there any chance you can specify examples of tests for validation table output?

case displayExceptions = true(default behavior):

Method Mean Error StdDev Median Exceptions
NoThrow 0.0002 ns 0.0004 ns 0.0003 ns 0.0000 ns -
Throw 2,260.6319 ns 5.4942 ns 4.8705 ns 2,262.6339 ns 1.0000

case displayExceptions = false:

Method Mean Error StdDev Median Exceptions
NoThrow 0.0008 ns 0.0014 ns 0.0012 ns 0.0002 ns NA
Throw 2,282.4955 ns 7.6377 ns 7.1443 ns 2,281.0249 ns 1.0000

@timcassell
Copy link
Collaborator

timcassell commented Oct 24, 2024

If any benchmark has a non-zero result, the entire column should display correct results regardless of the configuration. I think you can fix it by passing the configuration values to the metric descriptors and check them in the GetIsAvailable method.

You can add tests to SummaryTableTests. And/or add to MarkdownExporterVerifyTests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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