feat: Add overall estimated time remaining calculation#18
Conversation
This adds a `getOverallEstimatedTimeRemaining` method to calculate the global ETA of a task based on the average progress and the earliest start time of all local instances. This provides concrete value by allowing applications to display remaining time for complex multi-part jobs, completing the existing local ETA functionality. Co-authored-by: insign <1113045+insign@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0204e5acf8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * Get the estimated time remaining in seconds for the overall progress. | ||
| */ | ||
| public function getOverallEstimatedTimeRemaining(): ?int { | ||
| $overallProgress = $this->getOverallProgress(); |
There was a problem hiding this comment.
Use unrounded progress when computing overall ETA
getOverallEstimatedTimeRemaining() derives its rate from getOverallProgress(), which applies configured precision rounding before returning. That makes ETA depend on display precision: with low precision (or very small/near-complete real progress), the rounded value can become 0 (returning null) or 100 (returning 0) even though work is still in progress, so callers can get incorrect overall ETA. Compute ETA from raw progressData values (without presentation rounding) to avoid precision-induced errors.
Useful? React with 👍 / 👎.
|
Este PR ainda não está pronto porque o CI está vermelho. O job |
I have run |
Running `vendor/bin/pint` fixed missing blank lines and parenthesis warnings in `tests/IsOverallCompleteBugTest.php` that was causing the CI build to fail on Code Style check. Co-authored-by: insign <1113045+insign@users.noreply.github.com>
This PR introduces the ability to calculate the estimated time remaining for an entire job composed of multiple local processes.
It adds real value to the project by exposing
getOverallEstimatedTimeRemaining(), which calculates the remaining time by finding the earliest start time among all local tasks and dividing the remaining overall progress by the overall rate. This completes the ETA functionality, which previously was only available for individual local processes.Changes:
getOverallEstimatedTimeRemaininginsrc/Progressable.phpoverall_estimated_time_remainingin thetoArray()outputREADME.mdtests/OverallEtaTest.phpcovering different start times and progress levelstoArraytests intests/ProgressableTest.phpto include the new array keyPR created automatically by Jules for task 3790971146602252366 started by @insign