Skip to content

Fix issues in log_diagnostics example #18652

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

Merged
merged 3 commits into from
Apr 2, 2025

Conversation

kristoff3r
Copy link
Contributor

@kristoff3r kristoff3r commented Mar 31, 2025

Objective

Adopts / builds on top of #18435.

The log_diagnostics example has bit-rotted and accumulated multiple issues:

  • It didn't explain the ordering constraint on DefaultPlugins, as noted by the original PR
  • Apparently AssetCountDiagnosticsPlugin no longer exists (?!). I couldn't figure out when or why it was removed, maybe it got missed in Assets v2?
  • The comments didn't explain what kind of info you get by the various plugins, making you do work to figure it out
  • As far as I can tell RenderDiagnosticsPlugin currently doesn't register any diagnostics in the traditional sense, but is only focused on rendering spans? At least it doesn't print anything extra when added for me, so having it here is misleading. It didn't print anything because there was nothing to render in this example

Solution

  • Make all plugins be commented in to prevent further bit-rot
  • Remove reference to the missing plugin
  • Add extra comments describing the diagnostics in more detail
  • Add something to render so we get render diagnostics

Testing

Run the example, see relevant diagnostics printed out

@kristoff3r kristoff3r added C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 31, 2025
@kristoff3r kristoff3r force-pushed the log-diagnostics-example branch from 7857795 to 038fb7b Compare March 31, 2025 22:53
@kristoff3r
Copy link
Contributor Author

Hmm it looks like there should be render diagnostics, I'll try to figure out why it doesn't print anything and add it back.

@alice-i-cecile alice-i-cecile added the X-Uncontroversial This work is generally agreed upon label Mar 31, 2025
@alice-i-cecile
Copy link
Member

I hate commented out code T_T Thanks for fixing this.

Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

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

This should really have the render diagnostic plugin too

@kristoff3r
Copy link
Contributor Author

This should really have the render diagnostic plugin too

I re-added it and modified the example so it actually prints something. Without anything drawn it did nothing which just made it's inclusion in the example confusing.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 2, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 2, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Apr 2, 2025
Merged via the queue into bevyengine:main with commit 86fa2ac Apr 2, 2025
34 checks passed
mockersf pushed a commit that referenced this pull request Apr 3, 2025
# Objective

Adopts / builds on top of #18435.

The `log_diagnostics` example has bit-rotted and accumulated multiple
issues:
- It didn't explain the ordering constraint on DefaultPlugins, as noted
by the original PR
- Apparently `AssetCountDiagnosticsPlugin` no longer exists (?!). I
couldn't figure out when or why it was removed, maybe it got missed in
Assets v2?
- The comments didn't explain what kind of info you get by the various
plugins, making you do work to figure it out
- ~As far as I can tell `RenderDiagnosticsPlugin` currently doesn't
register any diagnostics in the traditional sense, but is only focused
on rendering spans? At least it doesn't print anything extra when added
for me, so having it here is misleading.~ It didn't print anything
because there was nothing to render in this example

## Solution

- Make all plugins be commented in to prevent further bit-rot
- Remove reference to the missing plugin
- Add extra comments describing the diagnostics in more detail
- Add something to render so we get render diagnostics

## Testing

Run the example, see relevant diagnostics printed out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants