| OLD | NEW |
| 1 // Application that runs the specified benchmark over CT's webpage archives. | 1 // Application that runs the specified benchmark over CT's webpage archives. |
| 2 package main | 2 package main |
| 3 | 3 |
| 4 import ( | 4 import ( |
| 5 "encoding/csv" | 5 "encoding/csv" |
| 6 "flag" | 6 "flag" |
| 7 "fmt" | 7 "fmt" |
| 8 "io/ioutil" | 8 "io/ioutil" |
| 9 "os" | 9 "os" |
| 10 "path/filepath" | 10 "path/filepath" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return | 49 return |
| 50 } | 50 } |
| 51 if *benchmarkName == "" { | 51 if *benchmarkName == "" { |
| 52 glog.Error("Must specify --benchmark_name") | 52 glog.Error("Must specify --benchmark_name") |
| 53 return | 53 return |
| 54 } | 54 } |
| 55 benchmarkArgs := *benchmarkExtraArgs | 55 benchmarkArgs := *benchmarkExtraArgs |
| 56 browserArgs := *browserExtraArgs | 56 browserArgs := *browserExtraArgs |
| 57 repeats := *repeatBenchmark | 57 repeats := *repeatBenchmark |
| 58 | 58 |
| 59 // Reset the local chromium checkout. |
| 60 if err := util.ResetCheckout(util.ChromiumSrcDir); err != nil { |
| 61 glog.Errorf("Could not reset %s: %s", util.ChromiumSrcDir, err) |
| 62 return |
| 63 } |
| 59 // Sync the local chromium checkout. | 64 // Sync the local chromium checkout. |
| 60 if err := util.SyncDir(util.ChromiumSrcDir); err != nil { | 65 if err := util.SyncDir(util.ChromiumSrcDir); err != nil { |
| 61 glog.Errorf("Could not gclient sync %s: %s", util.ChromiumSrcDir
, err) | 66 glog.Errorf("Could not gclient sync %s: %s", util.ChromiumSrcDir
, err) |
| 62 return | 67 return |
| 63 } | 68 } |
| 64 | 69 |
| 65 // Create the task file so that the master knows this worker is still bu
sy. | 70 // Create the task file so that the master knows this worker is still bu
sy. |
| 66 skutil.LogErr(util.CreateTaskFile(util.ACTIVITY_RUNNING_BENCHMARKS)) | 71 skutil.LogErr(util.CreateTaskFile(util.ACTIVITY_RUNNING_BENCHMARKS)) |
| 67 defer util.DeleteTaskFile(util.ACTIVITY_RUNNING_BENCHMARKS) | 72 defer util.DeleteTaskFile(util.ACTIVITY_RUNNING_BENCHMARKS) |
| 68 | 73 |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 } | 366 } |
| 362 writer := csv.NewWriter(csvFile) | 367 writer := csv.NewWriter(csvFile) |
| 363 defer writer.Flush() | 368 defer writer.Flush() |
| 364 for _, row := range [][]string{headers, values} { | 369 for _, row := range [][]string{headers, values} { |
| 365 if err := writer.Write(row); err != nil { | 370 if err := writer.Write(row); err != nil { |
| 366 return fmt.Errorf("Could not write to %s: %s", csvPath,
err) | 371 return fmt.Errorf("Could not write to %s: %s", csvPath,
err) |
| 367 } | 372 } |
| 368 } | 373 } |
| 369 return nil | 374 return nil |
| 370 } | 375 } |
| OLD | NEW |