feat(MonitoringSubsystem): provide Micrometer gauges for rendering.world #4950
+260
−29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I started looking at sending the stats available on the DebugOverlay screens to Micrometer, and this happened.
Conceptually, this is working in the area of MetricsMode and DebugMetricsSystem, but when I saw those were all relying on formatted strings with comments like this, it was clear I wouldn't be able to use those classes as they are now.
Terasology/engine/src/main/java/org/terasology/engine/rendering/world/WorldRenderer.java
Lines 216 to 219 in ce8d34f
Example of Defining Meters
Terasology/engine/src/main/java/org/terasology/engine/rendering/world/Meters.java
Lines 15 to 49 in 6098b45
Notable qualities of this:
Other miscellania:
Flux
here isn't for anything asynchronous. I switched from Stream because Flux has a few convenient processing methods that Stream lacks, such asdoOnDiscard
andmapNotNull
.Future considerations:
How to test
Brief description of how to test / confirm this PR before merging
Outstanding before merging
logger
calls than user-facing, and skip them.