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

BenchPlugin #618

Merged
merged 6 commits into from
Sep 25, 2023
Merged

BenchPlugin #618

merged 6 commits into from
Sep 25, 2023

Conversation

ennerf
Copy link
Collaborator

@ennerf ennerf commented Sep 25, 2023

Added an experimental BenchPlugin that displays a live benchmark of the current chart:

image

Clicking again or closing the window disables the measurements again

image

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.07% ⚠️

Comparison is base (16a1602) 48.00% compared to head (6dce285) 47.93%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #618      +/-   ##
============================================
- Coverage     48.00%   47.93%   -0.07%     
- Complexity     6180     6182       +2     
============================================
  Files           394      395       +1     
  Lines         38176    38235      +59     
  Branches       6085     6087       +2     
============================================
+ Hits          18325    18327       +2     
- Misses        18703    18762      +59     
+ Partials       1148     1146       -2     
Files Changed Coverage Δ
...io/fair_acc/chartfx/bench/LiveDisplayRecorder.java 0.00% <0.00%> (ø)
.../java/io/fair_acc/chartfx/plugins/BenchPlugin.java 0.00% <0.00%> (ø)
...c/main/java/io/fair_acc/chartfx/utils/FXUtils.java 82.55% <0.00%> (-1.13%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pr-explainer-bot
Copy link

Pull Request Review

Hey there! 👋 Here's a summary of the previous tasks and their results. Let's dive in!

Changes

  1. Line 51: The setTitle method in the createChart method is setting the title of the timeChart to just title. It would be better to include the prefix 'Benchmark: ' as it was before.
  2. Line 118: The BenchPlugin class is missing a package declaration. It should be added at the top of the file.

Suggestions

  1. Line 51: Instead of hardcoding the title in the setTitle method, it would be better to pass it as a parameter to the method.
  2. Line 118: The filterFunc variable in the BenchPlugin class could be renamed to something more descriptive, like measurementFilter.
  3. Line 118: The filterFunc variable in the BenchPlugin class could be made final since it is not reassigned.
  4. Line 118: The filterFunc variable in the BenchPlugin class could be extracted to a separate method for better readability.
  5. Line 118: The filterFunc variable in the BenchPlugin class could be documented with a Javadoc comment explaining its purpose and usage.
  6. Line 180: The getChartPanel method in the ChartPerformanceGraph class could be renamed to something more descriptive, like createChartPanel.
  7. Line 180: The getChartPanel method in the ChartPerformanceGraph class could be made static since it does not rely on any instance variables.
  8. Line 180: The getChartPanel method in the ChartPerformanceGraph class could be extracted to a separate class for better separation of concerns.
  9. Line 180: The getChartPanel method in the ChartPerformanceGraph class could be documented with a Javadoc comment explaining its purpose and usage.
  10. Line 260: The managedVisibilityProperty method in the FXUtils class could be renamed to something more descriptive, like bindManagedToVisible.
  11. Line 260: The managedVisibilityProperty method in the FXUtils class could be documented with a Javadoc comment explaining its purpose and usage.

Bugs

There are no potential bugs found in the code.

Improvements

  1. In ErrorDataSetRendererSample.java at line 21, consider extracting the creation of BenchPlugin into a separate method for better code organization and readability.
  2. In ErrorDataSetRendererStylingSample.java at line 454, consider extracting the creation of BenchPlugin into a separate method for better code organization and readability.
  3. In ErrorDataSetRendererSample.java at line 21, the creation of BenchPlugin can be refactored for better readability:
private void addBenchPlugin(XYChart chart) {
    chart.getPlugins().add(new BenchPlugin());
}
  1. In ErrorDataSetRendererStylingSample.java at line 454, the creation of BenchPlugin can be refactored for better readability:
private void addBenchPlugin(XYChart chart) {
    chart.getPlugins().add(new BenchPlugin());
}

Rating

Overall rating: 7.5/10

  • Readability: The code is generally readable, but there are some areas that could be improved with better variable naming and code organization.
  • Performance: The code seems to be performing well and there are no obvious performance issues.
  • Security: The code does not contain any security vulnerabilities.

That's it for the summary! If you have any questions or need further clarification, feel free to reach out. Happy coding! 😄🚀

wirew0rm
wirew0rm previously approved these changes Sep 25, 2023
Copy link
Member

@wirew0rm wirew0rm left a comment

Choose a reason for hiding this comment

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

Looks good!

Adds an easy way for library users to use the basic features of the instrumentation and serves as a nice showcase in the samples.

@sonarcloud
Copy link

sonarcloud bot commented Sep 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@wirew0rm wirew0rm merged commit 2cc8a28 into main Sep 25, 2023
8 of 10 checks passed
@wirew0rm wirew0rm deleted the ennerf/bench-plugin branch September 25, 2023 16:57
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

Successfully merging this pull request may close these issues.

None yet

2 participants