-
Notifications
You must be signed in to change notification settings - Fork 110
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
feat(ui): Add a terminal-based progress bar to Zebra #6235
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6235 +/- ##
========================================
Coverage 77.72% 77.73%
========================================
Files 304 304
Lines 39665 40087 +422
========================================
+ Hits 30830 31162 +332
- Misses 8835 8925 +90 |
049edde
to
30ce463
Compare
This is bug #5366, let's track it for the next few weeks and see if it happens again:
https://github.com/ZcashFoundation/zebra/actions/runs/4290568966/jobs/7475609940#step:8:88 |
6a4b15f
to
837421c
Compare
This is not a code review so i have no idea how easy will be to fix some or all o this issues. I think is a good idea but do not look good yet from a UX perspective in my opinion. Consider the following 2-3 minutes output with the progress bar feature enabled of a release build. I separated it into parts. Before the any progress bar is shown:
First batch of progress bars is displayed
Progress bars then show up again
While zebra is running:
At exit:
|
This is an experimental feature which is not on by default. We can make the UX better after we merge it, if it's a priority for the Zebra project. (Or if a volunteer contributor wants to do it.)
Please configure a separate log file so you don't see the logs. The instructions are at the top of this PR, and in the code comments as part of the list of Zebra features:
Sure, we can switch some of these progress bars so they have no limit. I'd like to get user feedback on which progress bars and limits are useful before we make these kinds of changes. Then if this feature becomes a priority, we can do that in a future PR.
These are all the same configuration issue, please configure the logs to go to a file.
I'm not sure what is happening here, it could be a bug in the underlying library, your terminal application, or your shell. You could try a different shell? I'm using Linux, bash, tmux, mosh, and macOS Terminal.app, so I'm not sure I can reproduce those errors. It might also go away if we remove the chain fork progress bars, because it adds or removes bars for each chain. I can do a bug report if we find some simple way to reproduce it. But I don't think it's a blocker for this PR, because the feature is off by default.
This is a missing feature in your terminal, try a different terminal application or shell.
When Zebra shuts down, it needs to stop its progress monitoring thread. This also stops the progress bars. I don't think we need to show progress after Zebra exits. |
My apologies for not following the instructions correctly. By removing the logs as instructed almost all the issues i reported are gone. There are still a few but i agree they are minor and it looks a lot better overall. I think the no logs should be the default behavior when the feature is active. I still think most of the bars are not needed but i understand that we can't invest time now to discuss what we want to show and how. Ill review the code and probably approve soon. |
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 looks absolutely marvelous, great work, thank you!!!
I'd love to see this become a default feature once it works with tracing logs being written to the terminal.
(Config options for which progress bars show up would also be nice)
Co-authored-by: Arya <[email protected]>
Co-authored-by: Arya <[email protected]>
Co-authored-by: Arya <[email protected]>
Co-authored-by: Arya <[email protected]>
I made this change in the PR, here's how it looks now: $ cargo run --features progress-bar --bin zebrad
Compiling zebrad v1.0.0-rc.6 (/home/dev/zebra/zebrad)
Finished release [optimized + debuginfo] target(s) in 47.07s
running zebra
directory for log file "/home/dev/.local/state/zebrad.log" does not exist, trying to create it...
sending logs to "/home/dev/.local/state/zebrad.log"...
waiting for initial progress reports... And then the progress bars show up (with no logs in the terminal). |
Motivation
Some users just want to see how Zebra's sync is progressing, without detailed logs.
You can see the progress bar by compiling Zebra with the
progress-bar
feature:This automatically redirects your logs to a file in the standard log path.
Closes #6245
Complex Code or Requirements
There are some shutdown delays, but they seem to be about the same as without the progress bar.
Solution
Terminal Display:
Block Progress:
Network Connections:
Mempool:
Related changes:
Review
This is a low priority change.
Reviewer Checklist
Follow Up Work
Write a blog post.
Tweak progress bars display.