Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: ct/go/ctfe/chromium_perf/chromium_perf.go

Issue 1411423003: [CT] Add ability to run unlanded benchmarks on Chromium Perf (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Add documentation link Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ct/go/db/db.go » ('j') | ct/go/db/db.go » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 Handlers and types specific to Chromium perf tasks. 2 Handlers and types specific to Chromium perf tasks.
3 */ 3 */
4 4
5 package chromium_perf 5 package chromium_perf
6 6
7 import ( 7 import (
8 "database/sql" 8 "database/sql"
9 "encoding/json" 9 "encoding/json"
10 "fmt" 10 "fmt"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 PageSets string `db:"page_sets"` 55 PageSets string `db:"page_sets"`
56 RepeatRuns int64 `db:"repeat_runs"` 56 RepeatRuns int64 `db:"repeat_runs"`
57 RunInParallel bool `db:"run_in_parallel"` 57 RunInParallel bool `db:"run_in_parallel"`
58 BenchmarkArgs string `db:"benchmark_args"` 58 BenchmarkArgs string `db:"benchmark_args"`
59 BrowserArgsNoPatch string `db:"browser_args_nopatch"` 59 BrowserArgsNoPatch string `db:"browser_args_nopatch"`
60 BrowserArgsWithPatch string `db:"browser_args_withpatch"` 60 BrowserArgsWithPatch string `db:"browser_args_withpatch"`
61 Description string `db:"description"` 61 Description string `db:"description"`
62 ChromiumPatch string `db:"chromium_patch"` 62 ChromiumPatch string `db:"chromium_patch"`
63 BlinkPatch string `db:"blink_patch"` 63 BlinkPatch string `db:"blink_patch"`
64 SkiaPatch string `db:"skia_patch"` 64 SkiaPatch string `db:"skia_patch"`
65 BenchmarkPatch string `db:"benchmark_patch"`
65 Results sql.NullString `db:"results"` 66 Results sql.NullString `db:"results"`
66 NoPatchRawOutput sql.NullString `db:"nopatch_raw_output"` 67 NoPatchRawOutput sql.NullString `db:"nopatch_raw_output"`
67 WithPatchRawOutput sql.NullString `db:"withpatch_raw_output"` 68 WithPatchRawOutput sql.NullString `db:"withpatch_raw_output"`
68 } 69 }
69 70
70 func (task DBTask) GetTaskName() string { 71 func (task DBTask) GetTaskName() string {
71 return "ChromiumPerf" 72 return "ChromiumPerf"
72 } 73 }
73 74
74 func (dbTask DBTask) GetPopulatedAddTaskVars() task_common.AddTaskVars { 75 func (dbTask DBTask) GetPopulatedAddTaskVars() task_common.AddTaskVars {
75 taskVars := &AddTaskVars{} 76 taskVars := &AddTaskVars{}
76 taskVars.Username = dbTask.Username 77 taskVars.Username = dbTask.Username
77 taskVars.TsAdded = ctutil.GetCurrentTs() 78 taskVars.TsAdded = ctutil.GetCurrentTs()
78 taskVars.RepeatAfterDays = strconv.FormatInt(dbTask.RepeatAfterDays, 10) 79 taskVars.RepeatAfterDays = strconv.FormatInt(dbTask.RepeatAfterDays, 10)
79 taskVars.Benchmark = dbTask.Benchmark 80 taskVars.Benchmark = dbTask.Benchmark
80 taskVars.Platform = dbTask.Platform 81 taskVars.Platform = dbTask.Platform
81 taskVars.PageSets = dbTask.PageSets 82 taskVars.PageSets = dbTask.PageSets
82 taskVars.RepeatRuns = strconv.FormatInt(dbTask.RepeatRuns, 10) 83 taskVars.RepeatRuns = strconv.FormatInt(dbTask.RepeatRuns, 10)
83 taskVars.RunInParallel = strconv.FormatBool(dbTask.RunInParallel) 84 taskVars.RunInParallel = strconv.FormatBool(dbTask.RunInParallel)
84 taskVars.BenchmarkArgs = dbTask.BenchmarkArgs 85 taskVars.BenchmarkArgs = dbTask.BenchmarkArgs
85 taskVars.BrowserArgsNoPatch = dbTask.BrowserArgsNoPatch 86 taskVars.BrowserArgsNoPatch = dbTask.BrowserArgsNoPatch
86 taskVars.BrowserArgsWithPatch = dbTask.BrowserArgsWithPatch 87 taskVars.BrowserArgsWithPatch = dbTask.BrowserArgsWithPatch
87 taskVars.Description = dbTask.Description 88 taskVars.Description = dbTask.Description
88 taskVars.ChromiumPatch = dbTask.ChromiumPatch 89 taskVars.ChromiumPatch = dbTask.ChromiumPatch
89 taskVars.BlinkPatch = dbTask.BlinkPatch 90 taskVars.BlinkPatch = dbTask.BlinkPatch
90 taskVars.SkiaPatch = dbTask.SkiaPatch 91 taskVars.SkiaPatch = dbTask.SkiaPatch
92 taskVars.BenchmarkPatch = dbTask.BenchmarkPatch
91 return taskVars 93 return taskVars
92 } 94 }
93 95
94 func (task DBTask) GetResultsLink() string { 96 func (task DBTask) GetResultsLink() string {
95 if task.Results.Valid { 97 if task.Results.Valid {
96 return task.Results.String 98 return task.Results.String
97 } else { 99 } else {
98 return "" 100 return ""
99 } 101 }
100 } 102 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 PageSets string `json:"page_sets"` 267 PageSets string `json:"page_sets"`
266 RepeatRuns string `json:"repeat_runs"` 268 RepeatRuns string `json:"repeat_runs"`
267 RunInParallel string `json:"run_in_parallel"` 269 RunInParallel string `json:"run_in_parallel"`
268 BenchmarkArgs string `json:"benchmark_args"` 270 BenchmarkArgs string `json:"benchmark_args"`
269 BrowserArgsNoPatch string `json:"browser_args_nopatch"` 271 BrowserArgsNoPatch string `json:"browser_args_nopatch"`
270 BrowserArgsWithPatch string `json:"browser_args_withpatch"` 272 BrowserArgsWithPatch string `json:"browser_args_withpatch"`
271 Description string `json:"desc"` 273 Description string `json:"desc"`
272 ChromiumPatch string `json:"chromium_patch"` 274 ChromiumPatch string `json:"chromium_patch"`
273 BlinkPatch string `json:"blink_patch"` 275 BlinkPatch string `json:"blink_patch"`
274 SkiaPatch string `json:"skia_patch"` 276 SkiaPatch string `json:"skia_patch"`
277 BenchmarkPatch string `json:"benchmark_patch"`
275 } 278 }
276 279
277 func (task *AddTaskVars) GetInsertQueryAndBinds() (string, []interface{}, error) { 280 func (task *AddTaskVars) GetInsertQueryAndBinds() (string, []interface{}, error) {
278 if task.Benchmark == "" || 281 if task.Benchmark == "" ||
279 task.Platform == "" || 282 task.Platform == "" ||
280 task.PageSets == "" || 283 task.PageSets == "" ||
281 task.RepeatRuns == "" || 284 task.RepeatRuns == "" ||
282 task.RunInParallel == "" || 285 task.RunInParallel == "" ||
283 task.Description == "" { 286 task.Description == "" {
284 return "", nil, fmt.Errorf("Invalid parameters") 287 return "", nil, fmt.Errorf("Invalid parameters")
285 } 288 }
286 if err := ctfeutil.CheckLengths([]ctfeutil.LengthCheck{ 289 if err := ctfeutil.CheckLengths([]ctfeutil.LengthCheck{
287 {"benchmark", task.Benchmark, 100}, 290 {"benchmark", task.Benchmark, 100},
288 {"platform", task.Platform, 100}, 291 {"platform", task.Platform, 100},
289 {"page_sets", task.PageSets, 100}, 292 {"page_sets", task.PageSets, 100},
290 {"benchmark_args", task.BenchmarkArgs, 255}, 293 {"benchmark_args", task.BenchmarkArgs, 255},
291 {"browser_args_nopatch", task.BrowserArgsNoPatch, 255}, 294 {"browser_args_nopatch", task.BrowserArgsNoPatch, 255},
292 {"browser_args_withpatch", task.BrowserArgsWithPatch, 255}, 295 {"browser_args_withpatch", task.BrowserArgsWithPatch, 255},
293 {"desc", task.Description, 255}, 296 {"desc", task.Description, 255},
294 {"chromium_patch", task.ChromiumPatch, db.LONG_TEXT_MAX_LENGTH}, 297 {"chromium_patch", task.ChromiumPatch, db.LONG_TEXT_MAX_LENGTH},
295 {"blink_patch", task.BlinkPatch, db.LONG_TEXT_MAX_LENGTH}, 298 {"blink_patch", task.BlinkPatch, db.LONG_TEXT_MAX_LENGTH},
296 {"skia_patch", task.SkiaPatch, db.LONG_TEXT_MAX_LENGTH}, 299 {"skia_patch", task.SkiaPatch, db.LONG_TEXT_MAX_LENGTH},
300 {"benchmark_patch", task.BenchmarkPatch, db.LONG_TEXT_MAX_LENGTH },
297 }); err != nil { 301 }); err != nil {
298 return "", nil, err 302 return "", nil, err
299 } 303 }
300 runInParallel := 0 304 runInParallel := 0
301 if task.RunInParallel == "True" { 305 if task.RunInParallel == "True" {
302 runInParallel = 1 306 runInParallel = 1
303 } 307 }
304 » return fmt.Sprintf("INSERT INTO %s (username,benchmark,platform,page_set s,repeat_runs,run_in_parallel, benchmark_args,browser_args_nopatch,browser_args_ withpatch,description,chromium_patch,blink_patch,skia_patch,ts_added,repeat_afte r_days) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);", 308 » return fmt.Sprintf("INSERT INTO %s (username,benchmark,platform,page_set s,repeat_runs,run_in_parallel, benchmark_args,browser_args_nopatch,browser_args_ withpatch,description,chromium_patch,blink_patch,skia_patch,benchmark_patch,ts_a dded,repeat_after_days) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);",
305 db.TABLE_CHROMIUM_PERF_TASKS), 309 db.TABLE_CHROMIUM_PERF_TASKS),
306 []interface{}{ 310 []interface{}{
307 task.Username, 311 task.Username,
308 task.Benchmark, 312 task.Benchmark,
309 task.Platform, 313 task.Platform,
310 task.PageSets, 314 task.PageSets,
311 task.RepeatRuns, 315 task.RepeatRuns,
312 runInParallel, 316 runInParallel,
313 task.BenchmarkArgs, 317 task.BenchmarkArgs,
314 task.BrowserArgsNoPatch, 318 task.BrowserArgsNoPatch,
315 task.BrowserArgsWithPatch, 319 task.BrowserArgsWithPatch,
316 task.Description, 320 task.Description,
317 task.ChromiumPatch, 321 task.ChromiumPatch,
318 task.BlinkPatch, 322 task.BlinkPatch,
319 task.SkiaPatch, 323 task.SkiaPatch,
324 task.BenchmarkPatch,
320 task.TsAdded, 325 task.TsAdded,
321 task.RepeatAfterDays, 326 task.RepeatAfterDays,
322 }, 327 },
323 nil 328 nil
324 } 329 }
325 330
326 func addTaskHandler(w http.ResponseWriter, r *http.Request) { 331 func addTaskHandler(w http.ResponseWriter, r *http.Request) {
327 task_common.AddTaskHandler(w, r, &AddTaskVars{}) 332 task_common.AddTaskHandler(w, r, &AddTaskVars{})
328 } 333 }
329 334
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 r.HandleFunc("/"+ctfeutil.GET_CHROMIUM_PERF_RUN_STATUS_URI, getTaskStatu sHandler).Methods("GET") 474 r.HandleFunc("/"+ctfeutil.GET_CHROMIUM_PERF_RUN_STATUS_URI, getTaskStatu sHandler).Methods("GET")
470 r.HandleFunc("/"+ctfeutil.CHROMIUM_PERF_PARAMETERS_POST_URI, parametersH andler).Methods("POST") 475 r.HandleFunc("/"+ctfeutil.CHROMIUM_PERF_PARAMETERS_POST_URI, parametersH andler).Methods("POST")
471 r.HandleFunc("/"+ctfeutil.CHROMIUM_PERF_CL_DATA_POST_URI, getCLHandler). Methods("POST") 476 r.HandleFunc("/"+ctfeutil.CHROMIUM_PERF_CL_DATA_POST_URI, getCLHandler). Methods("POST")
472 r.HandleFunc("/"+ctfeutil.ADD_CHROMIUM_PERF_TASK_POST_URI, addTaskHandle r).Methods("POST") 477 r.HandleFunc("/"+ctfeutil.ADD_CHROMIUM_PERF_TASK_POST_URI, addTaskHandle r).Methods("POST")
473 r.HandleFunc("/"+ctfeutil.GET_CHROMIUM_PERF_TASKS_POST_URI, getTasksHand ler).Methods("POST") 478 r.HandleFunc("/"+ctfeutil.GET_CHROMIUM_PERF_TASKS_POST_URI, getTasksHand ler).Methods("POST")
474 r.HandleFunc("/"+ctfeutil.UPDATE_CHROMIUM_PERF_TASK_POST_URI, updateTask Handler).Methods("POST") 479 r.HandleFunc("/"+ctfeutil.UPDATE_CHROMIUM_PERF_TASK_POST_URI, updateTask Handler).Methods("POST")
475 r.HandleFunc("/"+ctfeutil.WEBHOOK_ADD_CHROMIUM_PERF_TASK_POST_URI, addTr ybotTaskHandler).Methods("POST") 480 r.HandleFunc("/"+ctfeutil.WEBHOOK_ADD_CHROMIUM_PERF_TASK_POST_URI, addTr ybotTaskHandler).Methods("POST")
476 r.HandleFunc("/"+ctfeutil.DELETE_CHROMIUM_PERF_TASK_POST_URI, deleteTask Handler).Methods("POST") 481 r.HandleFunc("/"+ctfeutil.DELETE_CHROMIUM_PERF_TASK_POST_URI, deleteTask Handler).Methods("POST")
477 r.HandleFunc("/"+ctfeutil.REDO_CHROMIUM_PERF_TASK_POST_URI, redoTaskHand ler).Methods("POST") 482 r.HandleFunc("/"+ctfeutil.REDO_CHROMIUM_PERF_TASK_POST_URI, redoTaskHand ler).Methods("POST")
478 } 483 }
OLDNEW
« no previous file with comments | « no previous file | ct/go/db/db.go » ('j') | ct/go/db/db.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698