-
-
Notifications
You must be signed in to change notification settings - Fork 989
Description replaces Method name column in exporter #1243
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
Comments
Hey @dotMorten, thanks for the report! Originally,
What do you think? |
I think that's a good approach. I tried making my own subclass of the exporter, but so much is relying on logic deep down in the summary I found it rather hard to write a custom set of columns out - especially since the columns change with the number of parameters, loggers etc. |
For uniqueness shouldn't both the name and class be considered? In any case, I have the opposite need, and was indeed treating Description as a way to override the method name. This is the case, for example, when extending a benchmarks base class, and not wanting the subclass to have different names. So IMHO it would be good to have a Benchmark column, which defaults to the method name but can be overridden with an attribute (currently Description, but at some point this could be changed as a breaking change). This could be expected to be unique (within the class!), and if the user overrides it, it's their responsibility to make sure it remains so. I personally don't see a huge need for an arbitrary textual description, but why not. It's useful to compare unit test framework here, where the test name typically defaults to the method name but is still user-configurable. |
Sure. The main thing here is that the generated CSV format is quite useless for importing into a database to track performance over time. You're likely to update the description, so suddenly tests wouldn't match, and uniqueness isn't guaranteed. |
That depends... If you're using it simply as a way to define the benchmark name that isn't the method name, and you care about keeping names constant over time (because you're putting them into the database), then they indeed shouldn't be changed... This seems to be more a problem of naming - "Description" does usually imply a user-displayed text that isn't important for any program and can change at any time. If this were renamed to "Name" things would make more sense, and I'm not sure anyone actually needs a user-displayable Description separate from a simple Name (am comparing with unit testing frameworks, where that doesn't typically exist). |
If I set a description on a benchmark, I lose the method name in the generated CSV.
The method name is in a way the unique identifier of the benchmark, whereas a description is merely describing what the benchmark is meant to test, and not guaranteed to be unique either.
Could we instead of having a single "Method" column, have two:
Method
andDescription
so the output could have both? It becomes rather important when storing daily benchmarks in a database that the "ID" of the benchmark stays unique and consistent, but a description can be allowed to change any time.I assume this behavior is caused by this line:
BenchmarkDotNet/src/BenchmarkDotNet/Running/Descriptor.cs
Line 54 in ea0468f
But it's misleading in the report output to have the description listed under "Method"
The text was updated successfully, but these errors were encountered: