-
-
Notifications
You must be signed in to change notification settings - Fork 574
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
add length to progress bar #4100
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Miroslav and thanks!
There is an issue wrt. to making this work with large codebase. Even a linux kernel tarball may be problematic... we may need to find a better way.
src/scancode/cli.py
Outdated
@@ -1176,10 +1176,11 @@ def run_scanners( | |||
|
|||
progress_manager = None | |||
if not quiet: | |||
resources = list(((r.location, r.path) for r in codebase.walk() if r.is_file)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a problem when we have a codebase with 10 million files, we may need to find a better way? ... otherwise the system will literally be stalled for minutes before displaying a progress bar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the kernel, the delay is 45 sec until it traverses 200k files. While the scan itself runs several hours.
With -q there is no delay.
src/scancode/cli.py
Outdated
echo_func(f'Scan files for: {scan_names} with {processes} process(es)...') | ||
item_show_func = partial(path_progress_message, verbose=verbose) | ||
progress_manager = partial(progressmanager, | ||
item_show_func=item_show_func, | ||
item_show_func=item_show_func, length=len(resources)*2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the times 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because #3344 Otherwise the progressbar go to 170/170 and then continue to 340/170. This *2 can be removed when we find when we find where is the count done twice. I have a suspicion, but it needs more testing.
Several things I considered as an option:
|
I tried to improve the performance of walk() in aboutcode-org/commoncode#78 |
Related: aboutcode-org#2980 Signed-off-by: Miroslav Suchý <[email protected]>
so progress bar shows real progress Signed-off-by: Miroslav Suchý <[email protected]>
so the progress bar shows real progress
Fixes #3342
Tasks
Run tests locally to check for errors.
The testsuite is broken for me and produce lots of not relevant errors. I will appreciate testing.