| OLD | NEW |
| 1 /* | 1 /* |
| 2 The Cluster Telemetry poller checks for new pending tasks by polling the
Cluster Telemetry | 2 The Cluster Telemetry poller checks for new pending tasks by polling the
Cluster Telemetry |
| 3 frontend. Tasks are executed serially. | 3 frontend. Tasks are executed serially. |
| 4 */ | 4 */ |
| 5 | 5 |
| 6 package main | 6 package main |
| 7 | 7 |
| 8 import ( | 8 import ( |
| 9 "flag" | 9 "flag" |
| 10 "fmt" | 10 "fmt" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 chromium_perf.DBTask | 304 chromium_perf.DBTask |
| 305 } | 305 } |
| 306 | 306 |
| 307 func (task *ChromiumPerfTask) Execute() error { | 307 func (task *ChromiumPerfTask) Execute() error { |
| 308 token := statusTracker.StartTask(CHROMIUM_PERF) | 308 token := statusTracker.StartTask(CHROMIUM_PERF) |
| 309 runId := runId(task) | 309 runId := runId(task) |
| 310 // TODO(benjaminwagner): Since run_chromium_perf_on_workers only reads t
hese in order to | 310 // TODO(benjaminwagner): Since run_chromium_perf_on_workers only reads t
hese in order to |
| 311 // upload to Google Storage, eventually we should move the upload step h
ere to avoid writing | 311 // upload to Google Storage, eventually we should move the upload step h
ere to avoid writing |
| 312 // to disk. | 312 // to disk. |
| 313 for fileSuffix, patch := range map[string]string{ | 313 for fileSuffix, patch := range map[string]string{ |
| 314 » » ".chromium.patch": task.ChromiumPatch, | 314 » » ".chromium.patch": task.ChromiumPatch, |
| 315 » » ".skia.patch": task.SkiaPatch, | 315 » » ".skia.patch": task.SkiaPatch, |
| 316 » » ".benchmark.patch": task.BenchmarkPatch, |
| 316 } { | 317 } { |
| 317 // Add an extra newline at the end because git sometimes rejects
patches due to | 318 // Add an extra newline at the end because git sometimes rejects
patches due to |
| 318 // missing newlines. | 319 // missing newlines. |
| 319 patch = patch + "\n" | 320 patch = patch + "\n" |
| 320 patchPath := filepath.Join(os.TempDir(), runId+fileSuffix) | 321 patchPath := filepath.Join(os.TempDir(), runId+fileSuffix) |
| 321 if err := ioutil.WriteFile(patchPath, []byte(patch), 0666); err
!= nil { | 322 if err := ioutil.WriteFile(patchPath, []byte(patch), 0666); err
!= nil { |
| 322 return err | 323 return err |
| 323 } | 324 } |
| 324 defer skutil.Remove(patchPath) | 325 defer skutil.Remove(patchPath) |
| 325 } | 326 } |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 pollAndExecOnce() | 616 pollAndExecOnce() |
| 616 for { | 617 for { |
| 617 select { | 618 select { |
| 618 case <-workerHealthTick: | 619 case <-workerHealthTick: |
| 619 doWorkerHealthCheck() | 620 doWorkerHealthCheck() |
| 620 case <-pollTick: | 621 case <-pollTick: |
| 621 pollAndExecOnce() | 622 pollAndExecOnce() |
| 622 } | 623 } |
| 623 } | 624 } |
| 624 } | 625 } |
| OLD | NEW |