The Wayback Machine - https://web.archive.org/web/20201019181430/https://github.com/dotnet/BenchmarkDotNet/issues/1183
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

Plots of benchmarks without params have a double dash (--) in the name #1183

Open
simonech opened this issue Jun 24, 2019 · 5 comments
Open

Plots of benchmarks without params have a double dash (--) in the name #1183

simonech opened this issue Jun 24, 2019 · 5 comments

Comments

@simonech
Copy link

@simonech simonech commented Jun 24, 2019

For each Job, it adds plots about density, cumulative mean, and so on. But two files are named BenchmarkDotNet.Artifacts/results/MyBench.Sleeps-Time50--density.png and BenchmarkDotNet.Artifacts/results/MyBench.Sleeps-Time50--facetDensity.png, with the -- instead of single. Like some iteration variable is empty (since later there are names with -Default-
image

I've noticed that this last error only happens without parameters. When there are parameters involved, there are no -- files.

@marcnet80
Copy link
Contributor

@marcnet80 marcnet80 commented Jul 22, 2019

Hi, @AndreyAkinshin. Is this issue still actual? I can't reproduce it on Windows 10, R-3.6.1.
ExporterBase.cs => GetArtifactFullName(Summary summary):
$"{Path.Combine(summary.ResultsDirectoryPath, fileName)}-{FileCaption}{FileNameSuffix}.{FileExtension}";

@AndreyAkinshin
Copy link
Member

@AndreyAkinshin AndreyAkinshin commented Jul 22, 2019

@marcnet80 yes, the issue is still actual. I guess, the problem is in this line: https://github.com/dotnet/BenchmarkDotNet/blob/v0.11.5/src/BenchmarkDotNet/Templates/BuildPlots.R#L112
When params is empty, we get double dash in the file name.

@marcnet80
Copy link
Contributor

@marcnet80 marcnet80 commented Jul 23, 2019

@AndreyAkinshin, thank you for pointing, values for params are coming from generated ..-measurements.csv in this line of code:
https://github.com/dotnet/BenchmarkDotNet/blob/v0.11.5/src/BenchmarkDotNet/Templates/BuildPlots.R#L104
I open ..-measurements.csv and see that values for Params columns is empty, that's why @simonech has --
image
I can fix it in R-script, by checking params and adding additional variable or maybe better add default value for Params column in C#:
https://github.com/dotnet/BenchmarkDotNet/blob/v0.11.5/src/BenchmarkDotNet/Exporters/Csv/CsvMeasurementsExporter.cs#L98
Something like this (of course wrapp it in Presenter):
columns.Add(new MeasurementColumn("Params", (summary, report, m) => string.IsNullOrEmpty(report.BenchmarkCase.Parameters.PrintInfo) ? "Default" : report.BenchmarkCase.Parameters.PrintInfo));

@AndreyAkinshin
Copy link
Member

@AndreyAkinshin AndreyAkinshin commented Jul 24, 2019

@marcnet80 it's better to fix it in the R-script.

@marcnet80
Copy link
Contributor

@marcnet80 marcnet80 commented Jul 24, 2019

Ok. Pull-request added.

marcnet80 added a commit to marcnet80/BenchmarkDotNet that referenced this issue Jul 26, 2019
marcnet80 added a commit to marcnet80/BenchmarkDotNet that referenced this issue Jul 26, 2019
marcnet80 added a commit to marcnet80/BenchmarkDotNet that referenced this issue Jul 26, 2019
marcnet80 added a commit to marcnet80/BenchmarkDotNet that referenced this issue Aug 1, 2019
AndreyAkinshin added a commit that referenced this issue Aug 3, 2019
* Plots with a double dash (--) in the names (#1183)

#1183

* Plots with a double dash (--) in the names (#1183) 

remove "Default"

* Plots with a double dash (--) in the names (#1183) 

fix assignment operations

* Plots with a double dash (--) in the names (#1183) 

replace assignments operator

* Plots with a double dash (--) in the names (#1183)

#1212
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.