Commit aaa89879 authored by Bart Vercoulen's avatar Bart Vercoulen

Fixed collectDetailMetricsFromReader to handle a row with an empty user value.

parent d0015cea
......@@ -123,7 +123,7 @@ func collectDetailMetricsFromReader(reader io.Reader, scope string, ch chan<- pr
if !scanner.Scan() {
return fmt.Errorf("Failed to extract columns from input")
}
columnNames := strings.Fields(scanner.Text())
columnNames := strings.Split(scanner.Text(), "\t")
if len(columnNames) < 2 {
return fmt.Errorf("Input does not provide any columns")
}
......@@ -144,10 +144,13 @@ func collectDetailMetricsFromReader(reader io.Reader, scope string, ch chan<- pr
break
}
values := strings.Fields(row)
values := strings.Split(row, "\t")
if len(values) != len(columns)+1 {
return fmt.Errorf("error while parsing rows: value count does not match column count")
}
if values[0] == "" {
values[0] = "empty_user"
}
for i, value := range values[1:] {
f, err := strconv.ParseFloat(value, 64)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment