refactor: improve status output for v2 trees#1879
Conversation
WalkthroughThe changes refactor the handling, sorting, and presentation of tree data and queue information in the forester system. Output formatting is simplified, tree sorting is standardized, and queue statistics reporting is made more detailed and type-specific. Several debug print statements are removed, and function signatures are updated for improved efficiency and clarity. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ForesterStatus
participant Lib
participant QueueHelpers
User->>ForesterStatus: fetch_forester_status()
ForesterStatus->>ForesterStatus: Fetch and sort trees by merkle_tree
ForesterStatus->>Lib: run_queue_info(config, &sorted_trees, queue_type)
Lib->>QueueHelpers: print_*_queue_info(rpc, pubkey)
QueueHelpers-->>Lib: Print batch-level stats, return unprocessed count
Lib-->>ForesterStatus: Print queue info, update metrics
ForesterStatus-->>User: Print simplified assignments table
Estimated code review effort3 (~45 minutes) Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🔇 Additional comments (11)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
18bfdbf to
857ce59
Compare
| } else { | ||
| println!( | ||
| "│ {:9} │ {} │ UNASSIGNED (Eligible Index: {}) │", | ||
| "{:12}\t\t{}\tUNASSIGNED (Eligible Index: {})", |
There was a problem hiding this comment.
we could also use a table library for this, we use one in xtask
There was a problem hiding this comment.
I have another idea. I want to remove this command entirely and instead create a small http server with a /status endpoint, so then, we could create a custom dashboard
Summary by CodeRabbit
New Features
Improvements
Bug Fixes