Skip to content

Conversation

@angerman
Copy link

@angerman angerman commented Dec 3, 2025

Summary

  • Add timing information for build phases (cabal, stage1, stage2, bindist, test)
  • Add QUIET=1 mode to suppress output unless there's an error
  • Show timing summary at end of build (even on failure)
  • Save timing data to _build/timing/summary.txt
  • Enable QUIET=1 in devx CI workflow

Usage

make                  # Normal build with timing summary at end
make QUIET=1          # Quiet build - output only on error
make timing-summary   # Show timing summary only

Example Output

+------------------+---------------+--------+
| Phase            | Duration      | Status |
+------------------+---------------+--------+
| cabal            |        2m 15s | OK     |
| stage1           |       45m 10s | OK     |
| stage2           |     1h 24m 5s | OK     |
| bindist          |        1m 12s | OK     |
+------------------+---------------+--------+
| TOTAL            |    2h 12m 42s |        |
+------------------+---------------+--------+

Test plan

  • Run make and verify timing summary appears at end
  • Run make QUIET=1 and verify output is suppressed
  • Verify logs are stored in _build/logs/
  • Verify timing data is saved to _build/timing/summary.txt

@angerman
Copy link
Author

angerman commented Dec 3, 2025

This should only be merged after #117 is merged. But before #118 is merged. So that we can get the timing comparison between non, and minimal stage1.

- Add QUIET=1 flag to suppress verbose cabal output (shows only phase headers)
- Add timing instrumentation for build phases (cabal, stage1, stage2, etc.)
- Extract timing/quiet logic to mk/run-phase.sh helper script
- Add mk/timing-summary.sh to display phase durations in a formatted table
- Add timing-summary Makefile target to show build phase timings
- Mark test-phase-hooks-plugin as fragile on AArch64 Darwin

Files added:
- mk/run-phase.sh - Phase execution wrapper with timing and quiet mode
- mk/timing-summary.sh - Timing summary display script

Files modified:
- Makefile - Add QUIET variable, timing targets, and phase instrumentation
- testsuite/tests/plugins/all.T - Mark fragile test
- Add collect-metrics.sh for cross-platform CPU/memory sampling during builds
- Add plot-metrics.py to generate SVG visualizations of build metrics
- Generate separate build and test phase plots with wider aspect ratio (20:6)
- Collect metrics continuously during build and test phases
- Upload metrics plots to Cloudflare R2 for persistent storage
- Embed SVG plots in GitHub Job Summary with phase timing table
- Display peak memory usage and per-phase durations
- Enable QUIET=1 mode and timing-summary in CI workflow

R2 Configuration:
- Secrets: R2_METRICS_ACCESS_KEY_ID, R2_METRICS_SECRET_ACCESS_KEY, R2_METRICS_ENDPOINT
- Variables: R2_METRICS_BUCKET_NAME, R2_METRICS_PUBLIC_URL

Files added:
- mk/collect-metrics.sh - Cross-platform CPU/memory metrics collector
- mk/plot-metrics.py - Matplotlib-based SVG plot generator

Files modified:
- .github/workflows/ci.yml - Add metrics collection, R2 upload, and job summary
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