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

Side by Side Diff: dashboard/dashboard/elements/pinpoint-perf-job-dialog.html

Issue 3016673002: Dashboard - Add pinpoint-perf-job-dialog for perf try jobs.
Patch Set: Created 3 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <!--
3 Copyright 2017 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7
8 <link rel="import" href="/components/paper-button/paper-button.html">
9 <link rel="import" href="/components/paper-checkbox/paper-checkbox.html">
10 <link rel="import" href="/components/paper-dialog/paper-dialog.html">
11 <link rel="import" href="/components/paper-input/paper-input.html">
12 <link rel="import" href="/components/paper-spinner/paper-spinner.html">
13
14 <link rel="import" href="/dashboard/static/simple_xhr.html">
15
16 <dom-module is="pinpoint-perf-job-dialog">
17 <template>
18
19 <paper-dialog id="container" autoCloseDisabled="true">
20 <!-- Styling for paper-dialog's children. -->
21 <style>
22 paper-button[dialog-confirm] {
23 background: #4285f4;
24 color: #fff;
25 margin-bottom: 5px;
26 }
27
28 paper-input {
29 width: 400px;
30 }
31 </style>
32
33 <form on-submit="onSendToTrybot">
34 <table>
35 <tr>
36 <td>Record a before/after trace profile.</td>
37 </tr>
38 <tr>
39 <td>Perf try bot:</td>
40 <td>
41 <paper-input type="text" value="[[getBot(test_path)]]" disabled></ paper-input>
sullivan 2017/09/27 19:30:33 Eventually there needs to be some way to see the l
shatch 2017/09/27 20:41:25 Sure, I'll follow up and add the prefill. The exis
42 </td>
43 </tr>
44 <tr>
45 <td><paper-checkbox checked="{{use_trace::input}}"></paper-checkbox> Chrome trace <a href="https://cs.chromium.org/chromium/src/base/trace_event/trac e_config.h?rcl=c8db6c6371ca047c24d41f3972d5819bc83d83ae&l=125" target="_blank">f ilter string</a>:</td>
46 <td>
47 <paper-input value="{{trace_categories::input}}"></paper-input>
48 </td>
49 </tr>
50 <template is="dom-if" if="{{computeIsAndroidBot(bot)}}">
51 <tr>
52 <td><paper-checkbox checked="{{use_atrace::input}}"></paper-checkbox >Additional atrace categories (comma-separated):</td>
53 <td>
54 <paper-input value="{{atrace_categories::input}}"></paper-input>
55 </td>
56 </tr>
57 </template>
58 <tr>
59 <td>Start Commit:</td>
60 <td><paper-input id="start_commit" type="text" value="{{start_commit ::input}}"></paper-input></td>
61 </tr>
62 <tr>
63 <td>End Commit:</td>
64 <td><paper-input id="end_commit" type="text" value="{{end_commit::in put}}"></paper-input></td>
65 </tr>
66 </table>
67 </form>
68
69 <p class="error">{{error}}</p>
70
71 <paper-button dialog-confirm raised autofocus disabled$="{{computeHasError (error)}}"
72 on-click="onSendToTrybot">Send to Pinpoint</paper-button>
73 <paper-button dialog-dismiss raised>Close</paper-button>
74
75 <div id="toasts" hidden>
76 <div id="jobsubmitted">
77 <b>Pinpoint Job submitted!</b>
78 <a href="[[lastSubmittedJobUrl]]"
79 target="_blank">View job [[lastSubmittedJobId]].</a>
80 </div>
81 </div>
82 </paper-dialog>
83
84 </template>
85 <script>
86 'use strict';
87 (function() {
88 Polymer({
89 is: 'pinpoint-perf-job-dialog',
90 properties: {
sullivan 2017/09/27 19:30:33 Properties in JS should be camelCase (startCommit,
91 error: {
92 type: String,
93 value: '',
94 },
95 start_commit: {
96 type: String,
97 value: '',
98 },
99 end_commit: {
100 type: String,
101 value: '',
102 },
103 start_repository: {
104 type: String,
105 value: '',
106 },
107 end_repository: {
108 type: String,
109 value: '',
110 },
111 use_trace: {
112 type: Boolean,
113 },
114 use_atrace: {
115 type: Boolean,
116 },
117 atrace_categories: {
118 type: String,
119 },
120 trace_categories: {
121 type: String,
122 },
123 test_path: {
124 type: String,
125 value: '',
126 },
127 xsrfToken: {
128 }
129 },
130
131 computeHasError: errorMessage => !!errorMessage,
132 computeIsAndroidBot(bot) { return bot.indexOf('android') != -1; },
133
134 getBot(testPath) {
135 return testPath.split('/')[1];
sullivan 2017/09/27 19:30:33 I'm not seeing a bot here, I think it's because th
shatch 2017/09/27 20:41:25 Ooops last second js lint name changes.
136 },
137
138 /**
139 * Initializes and shows the trace form.
140 */
141 show() {
142 this.open();
143
144 this.atrace_categories =
145 'sched,freq,gfx,view,dalvik,webview,input,disk,am,' +
146 'wm,rs,binder_driver';
147 this.use_atrace = false;
148 this.trace_categories =
149 'toplevel,disabled-by-default-toplevel.flow';
150 this.use_trace = true;
151 },
152
153 /**
154 * Makes a request to Pinpoint to perform a perf try job.
155 */
156 async onSendToTrybot(event) {
157 const args = [];
158 if (this.use_trace) {
159 args.push(['--extra-chrome-categories', this.trace_categories]);
160 }
161 if (this.use_atrace) {
162 args.push(['--extra-atrace-categories', this.atrace_categories]);
163 }
164
165 const params = {
166 test_path: this.test_path,
167 start_commit: this.start_commit,
168 end_commit: this.end_commit,
169 start_repository: this.start_repository,
170 end_repository: this.end_repository,
171 extra_telemetry_args: args
172 };
173
174 try {
175 this.error = '';
176 this.create_disabled = true;
177 const results = await simple_xhr.asPromise(
178 '/pinpoint/new/perf_try', params);
179 this.lastSubmittedJobId = results.jobId;
180 this.lastSubmittedJobUrl = results.jobUrl;
181 this.fire('display-toast', {'content': this.$.jobsubmitted});
182 this.close();
183 } catch (e) {
184 this.error = e;
185 }
186 this.create_disabled = false;
187 },
188
189 open() {
190 this.$.container.open();
191 },
192
193 close() {
194 this.$.container.close();
195 }
196 });
197 })();
198 </script>
199 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698