Skip to content

fix: address julian-review findings for metrics code#165

Merged
angerman merged 1 commit into
stable-ghc-9.14from
fix/julian-review-pr162
Mar 3, 2026
Merged

fix: address julian-review findings for metrics code#165
angerman merged 1 commit into
stable-ghc-9.14from
fix/julian-review-pr162

Conversation

@angerman

@angerman angerman commented Mar 2, 2026

Copy link
Copy Markdown

Summary

  • collect-metrics.sh: Use POSIX pcpu (not %cpu), skip ps header, warn on unsupported OS, declare locals, document output formats and awk idioms
  • plot-metrics.py: Replace custom hex/rgb helpers with matplotlib.colors/colorsys builtins, fix va='top' copy-paste bug, move timedelta import to top-level
  • ci.yml: Add inline comments explaining why metrics steps use shell: bash

Test plan

  • bash -n mk/collect-metrics.sh passes
  • python3 -c "import ast; ast.parse(open('mk/plot-metrics.py').read())" passes
  • CI build succeeds (metrics collection + plot generation)

@hasufell

hasufell commented Mar 2, 2026

Copy link
Copy Markdown
Member

there were a lot more comments in my review

@angerman

angerman commented Mar 2, 2026

Copy link
Copy Markdown
Author

there were a lot more comments in my review

I know there were more in #121; these were the ones I had time to address so far.

@angerman angerman force-pushed the fix/julian-review-pr162 branch from a12fe82 to 05c9a04 Compare March 3, 2026 00:56
Comment thread mk/collect-metrics.sh
Comment thread mk/collect-metrics.sh Outdated
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
@angerman angerman force-pushed the fix/julian-review-pr162 branch from 05c9a04 to 4a78833 Compare March 3, 2026 09:42
@angerman angerman merged commit c6c50b0 into stable-ghc-9.14 Mar 3, 2026
42 of 54 checks passed
@angerman angerman deleted the fix/julian-review-pr162 branch March 3, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants