Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /** trybot is for loading and serving trybot performance results. | 1 /** trybot is for loading and serving trybot performance results. |
| 2 | 2 |
| 3 Implementation notes: | 3 Implementation notes: |
| 4 | 4 |
| 5 Regular files are in: | 5 Regular files are in: |
| 6 | 6 |
| 7 gs://chromium-skia-gm/nano-json-v1/2014/08/07/01/Perf-...-Release/nanobench_ da7a94...8d35a_1407357280.json | 7 gs://chromium-skia-gm/nano-json-v1/2014/08/07/01/Perf-...-Release/nanobench_ da7a94...8d35a_1407357280.json |
| 8 | 8 |
| 9 while trybots are in: | 9 while trybots are in: |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 ResultsFileLocation *ingester.ResultsFileLocation | 166 ResultsFileLocation *ingester.ResultsFileLocation |
| 167 IssueName string | 167 IssueName string |
| 168 } | 168 } |
| 169 | 169 |
| 170 type BenchByIssueSlice []*BenchByIssue | 170 type BenchByIssueSlice []*BenchByIssue |
| 171 | 171 |
| 172 func (p BenchByIssueSlice) Len() int { return len(p) } | 172 func (p BenchByIssueSlice) Len() int { return len(p) } |
| 173 func (p BenchByIssueSlice) Less(i, j int) bool { return p[i].IssueName < p[j].Is sueName } | 173 func (p BenchByIssueSlice) Less(i, j int) bool { return p[i].IssueName < p[j].Is sueName } |
| 174 func (p BenchByIssueSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } | 174 func (p BenchByIssueSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } |
| 175 | 175 |
| 176 func Init() { | 176 // The 'local' flag indicates whether we are running locally and forces the db |
| 177 » db.Init() | 177 // package to set up the DB accordingly. |
| 178 func Init(local bool) { | |
| 179 » db.Init(db.ProdConnectionString(local)) | |
|
jcgregorio
2014/09/30 19:12:03
Can we move the call to db.Init() into skiaperf/ma
stephana
2014/09/30 19:52:09
Done.
| |
| 178 var err error | 180 var err error |
| 179 st, err = storage.New(util.NewTimeoutClient()) | 181 st, err = storage.New(util.NewTimeoutClient()) |
| 180 if err != nil { | 182 if err != nil { |
| 181 panic("Can't construct HTTP client") | 183 panic("Can't construct HTTP client") |
| 182 } | 184 } |
| 183 elapsedTimePerUpdate = metrics.NewRegisteredTimer("ingester.trybot.nano. update", metrics.DefaultRegistry) | 185 elapsedTimePerUpdate = metrics.NewRegisteredTimer("ingester.trybot.nano. update", metrics.DefaultRegistry) |
| 184 metricsProcessed = metrics.NewRegisteredCounter("ingester.trybot.nano.pr ocessed", metrics.DefaultRegistry) | 186 metricsProcessed = metrics.NewRegisteredCounter("ingester.trybot.nano.pr ocessed", metrics.DefaultRegistry) |
| 185 numSuccessUpdates = metrics.NewRegisteredCounter("ingester.trybot.nano.u pdates", metrics.DefaultRegistry) | 187 numSuccessUpdates = metrics.NewRegisteredCounter("ingester.trybot.nano.u pdates", metrics.DefaultRegistry) |
| 186 } | 188 } |
| 187 | 189 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 return fmt.Errorf("Update failed to write trybot results : %s", err) | 232 return fmt.Errorf("Update failed to write trybot results : %s", err) |
| 231 } | 233 } |
| 232 } | 234 } |
| 233 | 235 |
| 234 numSuccessUpdates.Inc(1) | 236 numSuccessUpdates.Inc(1) |
| 235 elapsedTimePerUpdate.UpdateSince(begin) | 237 elapsedTimePerUpdate.UpdateSince(begin) |
| 236 glog.Infof("Finished trybot ingestion.") | 238 glog.Infof("Finished trybot ingestion.") |
| 237 | 239 |
| 238 return nil | 240 return nil |
| 239 } | 241 } |
| OLD | NEW |