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

JoinReport with unexpected results #11

Closed
swtrse opened this issue Aug 5, 2024 · 2 comments
Closed

JoinReport with unexpected results #11

swtrse opened this issue Aug 5, 2024 · 2 comments

Comments

@swtrse
Copy link
Contributor

swtrse commented Aug 5, 2024

I do have the following Artifacts
BenchmarkDotNet.Artifacts.zip

I tried to create a joint Report

var options = new JoinReportHtmlOptions
              {
	              Title = "Benchmark of Collection Item Manipulation (Mean)",
	              MainColumn = "Method",
	              GroupByColumns = ["Categories", "Prefill", "PriceRange"],
	              PivotProperty = "Runtime",
	              StatisticColumns = ["Mean"],
	              ColumnsOrder = [".NET 8.0", "NativeAOT 8.0", ".NET 9.0", "NativeAOT 9.0"],
	              OtherColumnsToSelect = ["DataType"],
	              SpectrumStatisticColumn = true,
	              HighlightGroups = true,
	              DividerMode = RenderTableDividerMode.SeparateTables,
	              HtmlWrapMode = HtmlDocumentWrapMode.RichDataTables
              };

await benchmarkSummaries.JoinReportsAndSaveAsHtmlAsync(DirectoryHelper.GetPathRelativeToProjectDirectory("Reports\\Benchmark-Mean.html"), options).ConfigureAwait(false);

The result looks like
image
As you can see there are additional Lines (like line 2) that I did not expect. I did experiment a bit and found out that DataType maybe the culprit.

So I changed the settings to

var options = new JoinReportHtmlOptions
              {
	              Title = "Benchmark of Collection Item Manipulation (Mean)",
	              MainColumn = "Method",
	              GroupByColumns = ["DataType", "Categories", "Prefill", "PriceRange"],
	              PivotProperty = "Runtime",
	              StatisticColumns = ["Mean"],
	              ColumnsOrder = [".NET 8.0", "NativeAOT 8.0", ".NET 9.0", "NativeAOT 9.0"],
	              SpectrumStatisticColumn = true,
	              HighlightGroups = true,
	              DividerMode = RenderTableDividerMode.SeparateTables,
	              HtmlWrapMode = HtmlDocumentWrapMode.RichDataTables
              };

await benchmarkSummaries.JoinReportsAndSaveAsHtmlAsync(DirectoryHelper.GetPathRelativeToProjectDirectory("Reports\\Benchmark-Mean.html"), options).ConfigureAwait(false);

Now I get this
image
This is too fragmented, but all the doubled lines are gone and the lines are exactly what I want to show.
Basically, I want Table 1 + Table 2 joined in one table and Table 3 + Table 4 joined in one table and so on....

Did I miss some settings or maybe the Join Report do have a little flaw with merging the reports?

swtrse added a commit to swtrse/BenchmarkDotNetVisualizer that referenced this issue Aug 7, 2024
If JoinReportHtmlOptions.OtherColumnsToSelect are used, rows are generated with every PivotProperty and StatisticColumn combination possible even if the values have no correlation in the initial benchmark data.
OtherColumnsToSelect should act as additional group key but without splitting the table. The design of the result table leads to this conclusion.
With this fix correct pivot tables are shown.
@swtrse
Copy link
Contributor Author

swtrse commented Aug 7, 2024

I did provide a pull request with the fix. However I did not test for side effects but for my case this is exactly what I needed.

This is the intended result
image

mjebrahimi added a commit that referenced this issue Aug 8, 2024
Fix for the #11 issue, thanks to @swtrse.
@mjebrahimi
Copy link
Owner

Thanks @swtrse. I closed this issue since you fixed it well.

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

No branches or pull requests

2 participants