fix: address julian-review findings for metrics code#165
Merged
Conversation
Member
|
there were a lot more comments in my review |
Author
I know there were more in #121; these were the ones I had time to address so far. |
a12fe82 to
05c9a04
Compare
hasufell
reviewed
Mar 3, 2026
hasufell
reviewed
Mar 3, 2026
collect-metrics.sh: - Factor case branches into named helpers (get_cpu_usage_darwin, get_cpu_usage_linux, get_memory_usage_darwin, get_memory_usage_linux) with thin dispatchers for the cross-platform functions - Initialize CPU_STATE_FILE at declaration instead of in run_collector() - Replace all `|| echo <default>` fallbacks with `exit 1` + error on stderr — silent zeros hide real failures in CI - Document /proc/stat guard (minimal containers without procfs) - Document SIGTERM choice in stop command - Fix usage message: METRICS_DIR is optional (brackets) - Add bash dependency note after shebang plot-metrics.py: - Add 5-stage data pipeline overview comment (COLLECT → READ → SELECT → FILTER → PLOT) - Add create_plot() docstring covering dual y-axes, phase shading, label alternation, and all arguments - Add inline comments explaining effective cores calculation, color assignment logic, and alternating label positions
05c9a04 to
4a78833
Compare
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.
Summary
pcpu(not%cpu), skip ps header, warn on unsupported OS, declare locals, document output formats and awk idiomsmatplotlib.colors/colorsysbuiltins, fixva='top'copy-paste bug, movetimedeltaimport to top-levelshell: bashTest plan
bash -n mk/collect-metrics.shpassespython3 -c "import ast; ast.parse(open('mk/plot-metrics.py').read())"passes