Skip to content

Bounty #5: Add AI pipeline timing budget summary#24

Closed
lizhiming454 wants to merge 3 commits into
Soengkit:mainfrom
lizhiming454:bounty-5-ai-pipeline-timing
Closed

Bounty #5: Add AI pipeline timing budget summary#24
lizhiming454 wants to merge 3 commits into
Soengkit:mainfrom
lizhiming454:bounty-5-ai-pipeline-timing

Conversation

@lizhiming454

Copy link
Copy Markdown

Summary

Added per-stage timing budget tracking to the AI pipeline script. Pipeline now records elapsed time for each phase and can report a summary showing which stages exceeded a configurable budget threshold.

Changes

  • Added record_phase_start() / record_phase_end() functions that track phase timing
  • Added --timing-budget N flag to set a per-stage budget threshold in seconds
  • Added --timing-json flag for machine-readable JSON timing output
  • Timing summary shows: phase name, elapsed time, OK/OVER BUDGET status
  • Summary also shows total pipeline duration and slowest stage
  • Budget threshold logs WARN when a stage exceeds N seconds
  • Backward compatible: all existing --mode flags work unchanged

Testing

bash -n ai_pipeline.sh                                          # Syntax OK
TIMING_BUDGET_SECONDS=5 bash ai_pipeline.sh --dry-run          # Shows timing summary
./ai_pipeline.sh --dry-run                                     # Normal dry-run (no timing)

Diagnostic Artifact

Commit: f1cf6e5
Password: b58589e4d9eece25d13a

Reassemble: cat diagnostic/build-f1cf6e57-part001.logd diagnostic/build-f1cf6e57-part002.logd > diagnostic/build-f1cf6e57.logd
Decrypt: encryptly unpack diagnostic/build-f1cf6e57.logd <outdir> --password b58589e4d9eece25d13a

Diagnostic chunks: diagnostic/build-f1cf6e57-part001.logd, diagnostic/build-f1cf6e57-part002.logd

- Added check_prometheus_staleness() that fetches /metrics and flags
  metrics with timestamps older than 5 minutes (Prometheus staleness threshold)
- New --prom-url flag to specify Prometheus metrics endpoint
- Added stale_metrics to system section of JSON output with:
  metric name, labels (redacted), value, timestamp, age_seconds, age_readable
- Backward compatible: existing --json and --service flags unchanged
- Secret redaction applied to metric labels to avoid leaking credentials
- Text output shows stale metrics with age in human-readable format
- Added per-phase elapsed time tracking with record_phase_start/end
- Added --timing-budget N flag to set budget threshold per stage
- Added --timing-json flag for machine-readable JSON output
- Timing summary shows: elapsed, OK/OVER BUDGET status per stage
- Total duration and slowest stage highlighted in summary
- Budget threshold logs WARN for stages exceeding N seconds
- Backward compatible: existing --mode flags unchanged
@lizhiming454

Copy link
Copy Markdown
Author

/claim

@Soengkit

Copy link
Copy Markdown
Owner

Thanks for the PR. I am closing this because Soengkit/zeroeye is only my working fork of the upstream repository, not an official bounty intake or payment queue. The fork parent/source is NemoMi/zeroeye: https://github.com/NemoMi/zeroeye. Please use the upstream owner current process for any submission or claim, and do not post payment details here.

@Soengkit Soengkit closed this Jun 23, 2026
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