feat(example): Improve path stat printing in transfer example#3860
Merged
feat(example): Improve path stat printing in transfer example#3860
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3860/docs/iroh/ Last updated: 2026-01-21T09:50:52Z |
Member
Author
|
Relevant issue: #3846 |
Contributor
|
ci sad |
Member
Author
|
CI sad for reasons unrelated to this PR :/
|
PathInfo::path_id and improve path stat printing in transfer example
Frando
approved these changes
Jan 21, 2026
Member
Frando
left a comment
There was a problem hiding this comment.
I manually tested and this now indeed prints all paths finally. Makes the path stats much more useful indeed.
It is a bit of a pity that this rather convoluted task is needed, but that's how it is for now. If we find better APIs to expose path stats in iroh, we can update. But for now let's merge this to at least have something that properly shows path stats for a connection in our codebase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before:
(also missing a bunch of stats from closed paths)
Now:
Notes & open questions
There's also something else that's ... weird at least. When the connection is dropped, and we call
PathInfo::stats, we get back the "fallback" valueself.stats, but that's only set initially and never updated. So this will look like the stats at the end are suddenly drastically decreasing.The transfer example now has two "side tasks": one for watching the path stats and one for watching the connection type.
I think I'd rather have them split than putting both of these tasks into one? Not sure if everyone might agree.