| OLD | NEW |
| 1 package buildbot_ingest | 1 package buildbot_ingest |
| 2 | 2 |
| 3 /* | 3 /* |
| 4 Loads data from build masters and pushes it into InfluxDB. | 4 Loads data from build masters and pushes it into InfluxDB. |
| 5 */ | 5 */ |
| 6 import ( | 6 import ( |
| 7 "fmt" | 7 "fmt" |
| 8 "path" | 8 "path" |
| 9 "sync" | 9 "sync" |
| 10 "time" | 10 "time" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 if len(results) == 0 { | 134 if len(results) == 0 { |
| 135 return -1, nil | 135 return -1, nil |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Error checking. | 138 // Error checking. |
| 139 if len(results) != 1 { | 139 if len(results) != 1 { |
| 140 return -1, fmt.Errorf("Query returned incorrect number of series
: %q", q) | 140 return -1, fmt.Errorf("Query returned incorrect number of series
: %q", q) |
| 141 } | 141 } |
| 142 series := results[0] | 142 series := results[0] |
| 143 if series.Name != SERIES_BUILDBOT_BYCOMMIT { | 143 if series.Name != SERIES_BUILDBOT_BYCOMMIT { |
| 144 » » return -1, fmt.Errorf("Query returned the wrong series: %q; expe
cted: %s got: %S", q, SERIES_BUILDBOT_BYCOMMIT, series.Name) | 144 » » return -1, fmt.Errorf("Query returned the wrong series: %q; expe
cted: %s got: %s", q, SERIES_BUILDBOT_BYCOMMIT, series.Name) |
| 145 } | 145 } |
| 146 if len(series.Columns) != 2 { | 146 if len(series.Columns) != 2 { |
| 147 return -1, fmt.Errorf("Query returned incorrect number of column
s: %q, %v", q, series.Columns) | 147 return -1, fmt.Errorf("Query returned incorrect number of column
s: %q, %v", q, series.Columns) |
| 148 } | 148 } |
| 149 if len(series.Points) != 1 { | 149 if len(series.Points) != 1 { |
| 150 return -1, fmt.Errorf("Query returned more than one point: %q",
q) | 150 return -1, fmt.Errorf("Query returned more than one point: %q",
q) |
| 151 } | 151 } |
| 152 p := series.Points[0] | 152 p := series.Points[0] |
| 153 if len(p) != len(series.Columns) { | 153 if len(p) != len(series.Columns) { |
| 154 return -1, fmt.Errorf("Number of columns does not match number o
f fields in datapoint: %v, %v", p, series.Columns) | 154 return -1, fmt.Errorf("Number of columns does not match number o
f fields in datapoint: %v, %v", p, series.Columns) |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 if err != nil { | 253 if err != nil { |
| 254 glog.Error(err) | 254 glog.Error(err) |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 }(m, b, builds) | 257 }(m, b, builds) |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 wg.Wait() | 260 wg.Wait() |
| 261 } | 261 } |
| 262 } | 262 } |
| OLD | NEW |