cmd/netcheck: better DERP latency checking output
Fixes #206 Signed-off-by: Zijie Lu <zijie@tailscale.com>
This commit is contained in:
parent
46f4b18fe8
commit
e3559d1c45
|
@ -51,6 +51,13 @@ func runNetcheck(ctx context.Context, args []string) error {
|
||||||
}
|
}
|
||||||
fmt.Printf("\t* MappingVariesByDestIP: %v\n", report.MappingVariesByDestIP)
|
fmt.Printf("\t* MappingVariesByDestIP: %v\n", report.MappingVariesByDestIP)
|
||||||
fmt.Printf("\t* HairPinning: %v\n", report.HairPinning)
|
fmt.Printf("\t* HairPinning: %v\n", report.HairPinning)
|
||||||
|
|
||||||
|
// When DERP latency checking failed,
|
||||||
|
// magicsock will try to pick the DERP server that
|
||||||
|
// most of your other nodes are also using
|
||||||
|
if len(report.DERPLatency) == 0 {
|
||||||
|
fmt.Printf("\t* Nearest DERP: unknown (no response to latency probes)\n")
|
||||||
|
} else {
|
||||||
fmt.Printf("\t* Nearest DERP: %v (%v)\n", report.PreferredDERP, c.DERP.LocationOfID(report.PreferredDERP))
|
fmt.Printf("\t* Nearest DERP: %v (%v)\n", report.PreferredDERP, c.DERP.LocationOfID(report.PreferredDERP))
|
||||||
fmt.Printf("\t* DERP latency:\n")
|
fmt.Printf("\t* DERP latency:\n")
|
||||||
var ss []string
|
var ss []string
|
||||||
|
@ -61,5 +68,6 @@ func runNetcheck(ctx context.Context, args []string) error {
|
||||||
for _, s := range ss {
|
for _, s := range ss {
|
||||||
fmt.Printf("\t\t- %s = %v\n", s, report.DERPLatency[s])
|
fmt.Printf("\t\t- %s = %v\n", s, report.DERPLatency[s])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue