-
Notifications
You must be signed in to change notification settings - Fork 5
hwgraph updates #98
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
hwgraph updates #98
Conversation
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
anisse
reviewed
Sep 10, 2025
f6d3ca1
to
ae5b064
Compare
anisse
reviewed
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in commit message: too adjascents -> two adjacents
Otherwise LGTM. |
20f4f09
to
ef02412
Compare
hwgraph command lines could be long. Reproducing the same graphs over time become almost impossible without reversing the type of graphs, titles & events. This commit simply saves the actual command line to a "cmdline" file so anyone can execute hwgraph again. Two tricks here : - the program name (argv[0]) is replaced by hwgraph to remove the full path, which is user specific - the use of shlex to save quotes around some arguments like the title. Signed-off-by: Erwan Velu <[email protected]>
Some graphs uses two y-axis to compare different metrics like "fan speed vs thermal". A bug was found were these graphs didn't rotate the x-label while the single axis graphs were fine. As a consequence, x-ticks labels colide making graphs nearly unreadable. To create a second y-axis, the "self.ax.twinx()" call is used. As a consequence, a second x-axis is also created and it seems that plt.xticks() was not rotating the two x-axis. As per some internet readings, the good way of rotating xlabels is to use the plt.setp() call proposed in this patch. As a result, both graphs types have their x-labels now properly rotated. Source: https://stackoverflow.com/questions/50596756/rotate-x-axis-labels-of-subplots-with-twinx Signed-off-by: Erwan Velu <[email protected]>
When plotting several events, - initial 5 colors were not enough: too much cycling - too much transparent : it's hard to see where events starts/stops This commit: - switch to a 9-color list that could be circled without visual issues: two adjascents colors can't be cycled unless they seems merged - increase alpha to 20% so event blocks are more visible Signed-off-by: Erwan Velu <[email protected]>
// Variable names The current code is not exposing units in time variable names. This makes the proof reading of the code being difficult. This commit is adding a time suffix on time variables like: _s : for seconds _ms : for milliseconds -ns : for nanoseconds i.e end_of_run become end_of_run_ns // Documentation The short inline documentation mentionned "stime" while no variable have that name. The documentation is update to use sleep_time_ns instead of stime. // Removing get_monotonic() helper As the helper is only using time.monotonic_ns(), let's remove the function and let's call the function directly. This is also making the return unit more explicit. Signed-off-by: Erwan Velu <[email protected]>
The current legends are inside the box preventing reading some of the values. This commit is fixing in space the two legends to ensure it's outside of the graphs. Signed-off-by: Erwan Velu <[email protected]>
It's usually hard to read some metrics and understand their actual values. This patch is about adding some statistics after each legend. The proposed format is : <name> [min(); mean(); stddev(); max()] This formating will the main statistics indicator for every items plotted in the graph. Signed-off-by: Erwan Velu <[email protected]>
When rendering units in percent, using 100% is problematic since this will be the maximum value of the graph. If the measured value is 100%, the graph will mix data and the frame of the graph making the data unreadable. This commit increase the max value to 110, so a 100% will be graphed below the max possible value, making it readable. Signed-off-by: Erwan Velu <[email protected]>
anisse
approved these changes
Oct 17, 2025
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.
Some tweaks to improve hwgraph rendering