perf net: Show the error with the bandwidth results (#4688)
An error in the result does not mean that the whole perf net test failed, we can still show some results, with an error as well, to be less confusing to the user.
This commit is contained in:
@@ -212,21 +212,12 @@ func (m *speedTestUI) View() string {
|
||||
})
|
||||
} else {
|
||||
for _, nodeResult := range nres.NodeResults {
|
||||
if nodeResult.Error != "" {
|
||||
data = append(data, []string{
|
||||
trailerIfGreaterThan(nodeResult.Endpoint, 64),
|
||||
crossTickCell,
|
||||
crossTickCell,
|
||||
"Err: " + nodeResult.Error,
|
||||
})
|
||||
} else {
|
||||
data = append(data, []string{
|
||||
trailerIfGreaterThan(nodeResult.Endpoint, 64),
|
||||
whiteStyle.Render(humanize.IBytes(uint64(nodeResult.RX))) + "/s",
|
||||
whiteStyle.Render(humanize.IBytes(uint64(nodeResult.TX))) + "/s",
|
||||
"",
|
||||
})
|
||||
}
|
||||
data = append(data, []string{
|
||||
trailerIfGreaterThan(nodeResult.Endpoint, 64),
|
||||
whiteStyle.Render(humanize.IBytes(uint64(nodeResult.RX))) + "/s",
|
||||
whiteStyle.Render(humanize.IBytes(uint64(nodeResult.TX))) + "/s",
|
||||
"Err: " + nodeResult.Error,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user