Skip to content

Conversation

@NelsonBN
Copy link
Member

Checklist before requesting a review

  • I have performed a self-review of my code.
  • Implemented tests for new features.
  • I tested the features already implemented.
  • Added usage examples in the readme.

@NelsonBN NelsonBN requested a review from Copilot June 22, 2025 02:04
@github-actions
Copy link

github-actions bot commented Jun 22, 2025

Test Summary

190 tests   190 ✅  0s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit f56ee76.

♻️ This comment has been updated with latest results.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for reporting garbage collection operations (Gen0, Gen1, Gen2) to the benchmark comparison tool.

  • Introduces CalculateGarbageCollectionOperations in MetricComparison to compute GC ops per 1000 iterations.
  • Extends ComparerReport with Gen0Collections, Gen1Collections, Gen2Collections and updates exporters (Markdown/Console) and command wiring.
  • Adds comprehensive tests for GC metrics in MetricComparison, table printing, exporters, and the comparer command.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Models/MetricComparison.cs New CalculateGarbageCollectionOperations
src/Models/ComparerReport.cs Added Gen0/Gen1/Gen2Collections properties
src/Helpers/PrintTable.cs TableBuilder supports dynamic columns/rows
src/Exporters/MarkdownExporter.cs Dynamically include GC columns in Markdown
src/Exporters/ConsoleExporter.cs Use TableBuilder to include GC columns
src/Commands/ComparerCommand.cs Populate GC metrics in report generation
tests/.../MetricComparisonTests.cs Tests for GC operations calculations
tests/.../PrintTableTest.cs Tests for table formatting
tests/.../MarkdownExporterTests.cs Tests for Markdown output with GC columns
tests/.../ConsoleExporterTests.cs Tests for Console output with GC columns
tests/.../ComparerCommandTests.cs Tests verifying command-generated GC metrics
Comments suppressed due to low confidence (3)

src/Helpers/PrintTable.cs:134

  • The method name _setColumnWith appears to be a typo; consider renaming it to _setColumnWidth for clarity.
    private void _setColumnWith(int columnIndex, int width)

src/Helpers/PrintTable.cs:20

  • Using params IEnumerable<string> can be confusing and may not match common usage; consider changing the signature to params string[] columns or IEnumerable<string> columns for clearer intent.
    public TableBuilder AddHeader(params IEnumerable<string> columns)

tests/PowerUtils.BenchmarkDotnet.Reporter.Tests/Commands/ComparerCommandTests.cs:667

  • [nitpick] The test method name contains duplicate phrases (Have_Has). Consider renaming it to When_Baseline_Has_Value_For_Gen0Collections_Should_Register_Baseline_GCComparison for clarity.
    public void When_Baseline_Have_Has_Value_For_Gen0Collections_Should_Have_Comparison_Baseline_With_For_Gen0Collections()

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
PBReporter 97% 82% 871
Summary 97% (831 / 860) 82% (599 / 734) 871

@github-actions
Copy link

@sonarqubecloud
Copy link

@NelsonBN NelsonBN merged commit 1a0b187 into main Jun 22, 2025
9 checks passed
@NelsonBN NelsonBN deleted the feat/add-gens branch June 22, 2025 09:43
@NelsonBN
Copy link
Member Author

🎉 This PR is included in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant