Skip to content

[Console][ProgressHelper] Added estimated time and memory usage #9572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

[Console][ProgressHelper] Added estimated time and memory usage #9572

wants to merge 2 commits into from

Conversation

lsv
Copy link

@lsv lsv commented Nov 22, 2013

see issue #9560

How to use it.

$progress = new ProgressHelper();
$progress->setFormat(ProgressHelper::FORMAT_VERBOSE_NOMAX);
$progress->start($this->output, count($rows));

And the output will be something like this

3 [>---------------------------] Elapsed: 10 secs Estimated: 6 mins (17.00MB)

The estimated is actually quite close to the time it took for my command (it took 5 min and 53 sec) - but of course it requires that all elements take the same time to execute.

The estimated time will be recalculated on each advance() (same time elapsed gets updated)

I havent quite figured out in which format the estimated should be in, so I only added it to FORMAT_VERBOSE_NOMAX, but should maybe be added to others as well?

@GromNaN
Copy link
Member

GromNaN commented Nov 22, 2013

👍

@@ -26,7 +26,7 @@ class ProgressHelper extends Helper
const FORMAT_VERBOSE = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add the memory indicator to FORMAT_VERBOSE.

@stof
Copy link
Member

stof commented Nov 22, 2013

Can you submit 2 different PRs for your 2 features instead of mixing the estimated time and the memory usage together ?

@lsv
Copy link
Author

lsv commented Nov 22, 2013

Do you want memory usage in FORMAT_VERBOSE and estimated in FORMAT_VERBOSE ?

@stof
Copy link
Member

stof commented Nov 22, 2013

@lsv the memory usage and the estimated time are 2 different features for the progress helper. So they should be in 2 separate PRs (which can be reviewed and merged separately) instead of being in a single PR (forcing us to accept both or none).
Btw, the PR description only tells us it introduces the estimated time, not the memory usage, so it does not describe what it does.

@lsv
Copy link
Author

lsv commented Nov 22, 2013

@stof
Memory usage: #9573
Estimated time left: #9574

@stof
Copy link
Member

stof commented Nov 22, 2013

Closing this is favor of the 2 other PRs

@stof stof closed this Nov 22, 2013
@lsv lsv deleted the progress-estimated branch November 22, 2013 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants