Skip to content
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(console): improve the output of node connections and node connection #1683

Merged
merged 10 commits into from
Oct 21, 2023

Conversation

divagant-martian
Copy link
Contributor

@divagant-martian divagant-martian commented Oct 19, 2023

Description

better formatting, plus giving information about the last time a peer was used, and which of it's addresses are in use

Notes & open questions

Sample output:

> node connections
 current time     Fri, 20 Oct 2023 23:10:53 +0000                      

 node id                                               region  conn type  latency    last used 
 2luekswh7o3a5tz4enymovsoksgnpb2qpmxlvifp6ywwjnacihya  1       direct     3ms,738μs  3s,356ms  
 3eqjtj7cfwaoj37h4uzn3iu5jdafs225bhuhuhih2qeq54udhmqa          none       unknown    never     
 ngz5gqow523yloxtbjlhnifymc5o7zeozv7ag33mjmuahjj7w7gq  2       relay      unknown    never     
 wgjifdn2anzlehy2zztndgc5ibggysunkfvdmginpjyq545uup7q  1       relay      unknown    never     
> node connection xce45urw3rnt6cjvn2igzqspvb2plh526ychpqk5won55vvzzwwa
 current time     Fri, 20 Oct 2023 23:10:53 +0000                      
 node id          xce45urw3rnt6cjvn2igzqspvb2plh526ychpqk5won55vvzzwwa 
 derp region      1                                                    
 connection type  direct                                               
 latency          3ms,139μs                                            
 last used        1s                                                   
 known addresses  8                                                    

 addr                latency    last control       last data 
 192.168.0.22:37030  3ms,557μs  call me ( 522ms )  1s        
 192.168.0.11:37030  3ms,194μs  call me ( 522ms )  1s        
 181.61.61.72:38903  2ms,256μs  call me ( 36m )    1h        
 181.61.61.72:28613  3ms,139μs  call me ( 522ms )  1s        
 181.61.61.72:41324  3ms,216μs  call me ( 522ms )  20m       
 181.61.61.72:28607  7ms,605μs  pong← ( 19m )      19m       
 192.168.0.21:37030  3ms,158μs  pong← ( 20m )      20m       
 181.61.61.72:28584  2ms,593μs  pong← ( 20m )      20m       

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

@divagant-martian divagant-martian changed the title add last used to peers feat(console): improve the output of node connections and node connection Oct 19, 2023
Copy link
Member

@b5 b5 left a comment

Choose a reason for hiding this comment

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

ux approval only, def get a code review as well

I'm a fan. My one nit: the "525μs" feels a bit noisy, but it's not too bad, and not really worth removing. from a UX perspective this is a big win. Thanks!

/// The type of connection we have to the peer, either direct or over relay.
pub conn_type: ConnectionType,
/// The latency of the `conn_type`.
pub latency: Option<Duration>,
/// Duration since the last time this peer was used.
pub last_used: Option<Duration>,
Copy link
Contributor

Choose a reason for hiding this comment

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

why not report last_used on a per addr level?

@dignifiedquire dignifiedquire added this to the v0.8.0 milestone Oct 20, 2023
@divagant-martian
Copy link
Contributor Author

this was pretty annoying taking into account how little it changed but output should be a bit more useful now as discussed

@b5
Copy link
Member

b5 commented Oct 20, 2023

this should close #1576, right?

@divagant-martian divagant-martian linked an issue Oct 21, 2023 that may be closed by this pull request
@divagant-martian
Copy link
Contributor Author

for now yes, if we want further goodies we can open a new one. Issue linked, ty

@divagant-martian divagant-martian added this pull request to the merge queue Oct 21, 2023
Merged via the queue into n0-computer:main with commit d0c7cac Oct 21, 2023
15 checks passed
@divagant-martian divagant-martian deleted the connection-info branch December 10, 2023 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

clean up output for node connections
3 participants