Improve output of incomplete measurements

Rename done to is_done
This commit is contained in:
Arturo Filastò 2018-09-17 13:04:48 +02:00
parent 4738f7f32d
commit 6c49bd694f
2 changed files with 8 additions and 2 deletions

View File

@ -80,6 +80,7 @@ func logResultItem(w io.Writer, f log.Fields) error {
rID := f.Get("id").(int64) rID := f.Get("id").(int64)
name := f.Get("name").(string) name := f.Get("name").(string)
isDone := f.Get("is_done").(bool)
startTime := f.Get("start_time").(time.Time) startTime := f.Get("start_time").(time.Time)
networkName := f.Get("network_name").(string) networkName := f.Get("network_name").(string)
asn := fmt.Sprintf("AS%d (%s)", f.Get("asn").(uint), f.Get("network_country_code").(string)) asn := fmt.Sprintf("AS%d (%s)", f.Get("asn").(uint), f.Get("network_country_code").(string))
@ -114,7 +115,12 @@ func logResultItem(w io.Writer, f log.Fields) error {
util.RightPad(summary[2], colWidth))) util.RightPad(summary[2], colWidth)))
if index == totalCount-1 { if index == totalCount-1 {
if isDone == true {
fmt.Fprintf(w, "└┬──────────────┬──────────────┬──────────────────┬┘\n") fmt.Fprintf(w, "└┬──────────────┬──────────────┬──────────────────┬┘\n")
} else {
// We want the incomplete section to not have a footer
fmt.Fprintf(w, "└──────────────────────────────────────────────────┘\n")
}
} }
return nil return nil
} }

View File

@ -110,7 +110,7 @@ func ResultItem(result ResultItemData) {
"network_name": result.NetworkName, "network_name": result.NetworkName,
"asn": result.ASN, "asn": result.ASN,
"runtime": result.Runtime, "runtime": result.Runtime,
"done": result.Done, "is_done": result.Done,
"data_usage_down": result.DataUsageDown, "data_usage_down": result.DataUsageDown,
"data_usage_up": result.DataUsageUp, "data_usage_up": result.DataUsageUp,
"index": result.Index, "index": result.Index,