@@ -174,9 +174,9 @@ func run() int {
174174		if  err  :=  json .Unmarshal (recv .Response , & resp ); err  !=  nil  {
175175			panic (err )
176176		}
177- 		table .SetHeader ([]string {"URI" , "State" , "Dir" , "IP Address" , "Uptime" , "RTT" , "RX" , "TX" , "Pr" , "Last Error" })
177+ 		table .SetHeader ([]string {"URI" , "State" , "Dir" , "IP Address" , "Uptime" , "RTT" , "RX" , "TX" , "Pr" , "Cost"  ,  " Last Error" })
178178		for  _ , peer  :=  range  resp .Peers  {
179- 			state , lasterr , dir , rtt   :=  "Up" , "-" , "Out" , "-" 
179+ 			state , lasterr , dir , rtt ,  cost   :=  "Up" , "-" , "Out"  ,  "- " , "-" 
180180			if  ! peer .Up  {
181181				state , lasterr  =  "Down" , fmt .Sprintf ("%s ago: %s" , peer .LastErrorTime .Round (time .Second ), peer .LastError )
182182			} else  if  rttms  :=  float64 (peer .Latency .Microseconds ()) /  1000 ; rttms  >  0  {
@@ -190,6 +190,9 @@ func run() int {
190190				uri .RawQuery  =  "" 
191191				uristring  =  uri .String ()
192192			}
193+ 			if  peer .Cost  <  uint64 (^ uint32 (0 )) {
194+ 				cost  =  fmt .Sprintf ("%d" , peer .Cost )
195+ 			}
193196			table .Append ([]string {
194197				uristring ,
195198				state ,
@@ -200,6 +203,7 @@ func run() int {
200203				peer .RXBytes .String (),
201204				peer .TXBytes .String (),
202205				fmt .Sprintf ("%d" , peer .Priority ),
206+ 				cost ,
203207				lasterr ,
204208			})
205209		}
0 commit comments