internal/plots: refactor + add new go1.26 plots#142
Merged
Conversation
Handle metric indices on a per go version basis (for now only
pre and post 1.26) and declare them as globals, thus allowing plot
description from not requiring to store them.
We now also don't need to have an object, since we need only need a
very thing state, if at all, to compute plot values from metrics. In
fact we just need a function. So declare the getvalues closure directly
in the declaration of each plot description{}.
With the additions of small wrappers to compute delta and rate from
metrics, the getvalues becomes very short and simple, much more maintable.
By calling mustidx in the global scope rather than in init(), we ensure that metric indices are known when registering plots, which help for dynamic layout building required for histograms.
9058bb7 to
98d9b15
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #142 +/- ##
==========================================
+ Coverage 59.88% 61.94% +2.05%
==========================================
Files 2 3 +1
Lines 177 226 +49
==========================================
+ Hits 106 140 +34
- Misses 66 77 +11
- Partials 5 9 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Major refactoring of the internal plot architecture: moved from monolithic plots.go and layouts.go files to one plot per file, self-registration, reducing sensibly the code by (666 lines) and improving maintainability.
Added support for new Go 1.26 scheduler metrics including a threads plot (/sched/threads/total:threads) and enhanced goroutines plot with granular state tracking (not-in-go, runnable, running, waiting).
Introduced auto-generated metric indices with build tag support for version-specific plots.
_example: cleanup by removing go.sum
Fix #119
Updates #139