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

Ability to configure benchmark class name in outputs #1651

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cdonke
Copy link

@cdonke cdonke commented Feb 19, 2021

Implementation of attribute to rename class.

image
image
image
image

Closes #1447

namespace BenchmarkDotNet.Attributes
{
[AttributeUsage(AttributeTargets.Class)]
public class BenchmarkNameAttribute : Attribute
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think DescriptionAttribute would be a better name. It matches the Description property of BenchmarkAttribute.

@AndreyAkinshin
Copy link
Member

Here are some ideas from my side:

  1. I agree with @timcassell, BenchmarkName can be a confusing name in such a situation. I would suggest BenchmarkDescription.
  2. If we introduce such an attribute, it makes sense to "extract" the Description property from the [Benchmark] attribute to be consistent and annotate both methods and classes with a new attribute.
  3. Currently, a benchmark description overrides the method name. I would suggest splitting the original class/method names and their descriptions in the exporters so that we always have access to the original names during csv/json/xml/etc parsing.
  4. In the Summary table I would suggest using "adaptive" default column that shows a description if it's available and the original name otherwise.

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.

Ability to configure benchmark class name in outputs
3 participants