Description
An individual benchmark method's name can be overridden for output purposes via the Description property on BenchmarkAttribute (see #1243 for a related issue on this). However, there doesn't seem to be a way to do the same for the entire class.
My use case: we have a superclass of benchmarks being extended for different databases, so an abstract OpenConnectionBenchmarks class gets extended by SqliteOpenConnectionBenchmarks. However, in the outputs (CSV going into a database) it's desirable to have OpenConnectionBenchmarks, as the database is tracked elsewhere.
Activity
adamsitnik commentedon May 4, 2020
Hello @roji ;)
I want to make sure that I understand you correctly. So you have sth like the code below:
And you don't like the fact that the output results contain the full type name:
SqliteOpenConnectionBenchmarks.Benchmark
and you would like theSqliteOpenConnectionBenchmarks.csv
file to contain results that use idOpenConnectionBenchmarks.Benchmark
?roji commentedon May 4, 2020
Yep, that's pretty much it. I worked around it by renaming the classes, but that's not ideal (now there are several classes with the same name, making it difficult to navigate in the IDE). So not urgent or anything, but it seems like there should be a way to determine output names both at the class and method level (ideally something consistent between the two as well).
roji commentedon May 6, 2020
Another scenario: have a Benchmarks postfix on class names (e.g. ConnectBenchmarks), but remove the postfix in outputs.
adamsitnik commentedon Oct 21, 2020
The best thing I can do as of today is to mark it as up-for-grabs and hope that someone is going to pick it up.
The contributor who is willing to work on this should:
benchmark.Descriptor.Type.Name
JobaDiniz commentedon Jun 13, 2023
I see that the PR #1651 has been opened for 2.5 years. If there's something wrong with it, can I grab this issue and make another one? What's the hold on merging that PR?
timcassell commentedon Jul 21, 2023
@JobaDiniz I don't mind if you want to send a separate PR if @cdonke is unavailable to update his. Just take note of the comments left in #1651.