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

Side by Side Diff: tracing/tracing/metrics/system_health/estimated_input_latency_metric_test.html

Issue 2698003004: Add a function that computes contribution of selected events to EQT. (Closed)
Patch Set: Fix comment Created 3 years, 10 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 | « tracing/tracing/metrics/system_health/estimated_input_latency_metric.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2017 The Chromium Authors. All rights reserved. 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 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/core/test_utils.html"> 8 <link rel="import" href="/tracing/core/test_utils.html">
9 <link rel="import" href="/tracing/metrics/system_health/estimated_input_latency_ metric.html"> 9 <link rel="import" href="/tracing/metrics/system_health/estimated_input_latency_ metric.html">
10 <link rel="import" href="/tracing/value/histogram_set.html"> 10 <link rel="import" href="/tracing/value/histogram_set.html">
(...skipping 18 matching lines...) Expand all
29 }); 29 });
30 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 30 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
31 cat: 'loading', 31 cat: 'loading',
32 title: 'firstMeaningfulPaintCandidate', 32 title: 'firstMeaningfulPaintCandidate',
33 start: timestamp, 33 start: timestamp,
34 duration: 0.0, 34 duration: 0.0,
35 args: {frame: '0xdeadbeef'} 35 args: {frame: '0xdeadbeef'}
36 })); 36 }));
37 } 37 }
38 38
39 test('estimatedInputLatency', function() { 39 test('expectedQueueingTime', function() {
40 let model = tr.c.TestUtils.newModel((model) => { 40 let model = tr.c.TestUtils.newModel((model) => {
41 let rendererProcess = model.getOrCreateProcess(1984); 41 let rendererProcess = model.getOrCreateProcess(1984);
42 let mainThread = rendererProcess.getOrCreateThread(2); 42 let mainThread = rendererProcess.getOrCreateThread(2);
43 mainThread.name = 'CrRendererMain'; 43 mainThread.name = 'CrRendererMain';
44 addInteractiveTimestamp(rendererProcess, mainThread, 200); 44 addInteractiveTimestamp(rendererProcess, mainThread, 200);
45 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 45 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
46 cat: 'toplevel', 46 cat: 'toplevel',
47 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 47 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
48 start: 0, 48 start: 0,
49 duration: 100, 49 duration: 100,
50 })); 50 }));
51 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 51 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
52 cat: 'toplevel', 52 cat: 'toplevel',
53 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 53 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
54 start: 3000, 54 start: 3000,
55 duration: 10, 55 duration: 10,
56 })); 56 }));
57 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 57 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
58 cat: 'toplevel', 58 cat: 'toplevel',
59 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 59 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
60 start: 9000, 60 start: 9000,
61 duration: 10, 61 duration: 10,
62 })); 62 }));
63 }); 63 });
64 let values = new tr.v.HistogramSet(); 64 let values = new tr.v.HistogramSet();
65 tr.metrics.sh.estimatedInputLatency(values, model); 65 tr.metrics.sh.expectedQueueingTimeMetric(values, model);
66 let interactiveEQT = values.getHistogramNamed( 66 let interactiveEQT = values.getHistogramNamed(
67 'interactive:500ms_window:renderer_eqt'); 67 'interactive:500ms_window:renderer_eqt');
68 assert.equal(0.1, interactiveEQT.average); 68 assert.equal(0.1, interactiveEQT.average);
69 let totalEQT = values.getHistogramNamed( 69 let totalEQT = values.getHistogramNamed(
70 'total:500ms_window:renderer_eqt'); 70 'total:500ms_window:renderer_eqt');
71 assert.equal(10, totalEQT.average); 71 assert.equal(10, totalEQT.average);
72 }); 72 });
73 73
74 test('estimatedInputLatency_noInteractive', function() { 74 test('expectedQueueingTime_noInteractive', function() {
75 let model = tr.c.TestUtils.newModel((model) => { 75 let model = tr.c.TestUtils.newModel((model) => {
76 let rendererProcess = model.getOrCreateProcess(1984); 76 let rendererProcess = model.getOrCreateProcess(1984);
77 let mainThread = rendererProcess.getOrCreateThread(2); 77 let mainThread = rendererProcess.getOrCreateThread(2);
78 mainThread.name = 'CrRendererMain'; 78 mainThread.name = 'CrRendererMain';
79 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 79 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
80 cat: 'toplevel', 80 cat: 'toplevel',
81 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 81 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
82 start: 0, 82 start: 0,
83 duration: 100, 83 duration: 100,
84 })); 84 }));
85 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 85 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
86 cat: 'toplevel', 86 cat: 'toplevel',
87 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 87 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
88 start: 3000, 88 start: 3000,
89 duration: 10, 89 duration: 10,
90 })); 90 }));
91 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 91 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
92 cat: 'toplevel', 92 cat: 'toplevel',
93 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 93 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
94 start: 9000, 94 start: 9000,
95 duration: 10, 95 duration: 10,
96 })); 96 }));
97 }); 97 });
98 let values = new tr.v.HistogramSet(); 98 let values = new tr.v.HistogramSet();
99 tr.metrics.sh.estimatedInputLatency(values, model); 99 tr.metrics.sh.expectedQueueingTimeMetric(values, model);
100 let interactiveEQT = values.getHistogramNamed( 100 let interactiveEQT = values.getHistogramNamed(
101 'interactive:500ms_window:renderer_eqt'); 101 'interactive:500ms_window:renderer_eqt');
102 assert.equal(0, interactiveEQT.numValues); 102 assert.equal(0, interactiveEQT.numValues);
103 }); 103 });
104 104
105 test('estimatedInputLatency_multipleInteractive', function() { 105 test('expectedQueueingTime_multipleInteractive', function() {
106 let model = tr.c.TestUtils.newModel((model) => { 106 let model = tr.c.TestUtils.newModel((model) => {
107 let rendererProcess = model.getOrCreateProcess(1984); 107 let rendererProcess = model.getOrCreateProcess(1984);
108 let mainThread = rendererProcess.getOrCreateThread(2); 108 let mainThread = rendererProcess.getOrCreateThread(2);
109 mainThread.name = 'CrRendererMain'; 109 mainThread.name = 'CrRendererMain';
110 addInteractiveTimestamp(rendererProcess, mainThread, 200); 110 addInteractiveTimestamp(rendererProcess, mainThread, 200);
111 addInteractiveTimestamp(rendererProcess, mainThread, 400); 111 addInteractiveTimestamp(rendererProcess, mainThread, 400);
112 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 112 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
113 cat: 'toplevel', 113 cat: 'toplevel',
114 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 114 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
115 start: 0, 115 start: 0,
116 duration: 100, 116 duration: 100,
117 })); 117 }));
118 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 118 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
119 cat: 'toplevel', 119 cat: 'toplevel',
120 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 120 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
121 start: 3000, 121 start: 3000,
122 duration: 10, 122 duration: 10,
123 })); 123 }));
124 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 124 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
125 cat: 'toplevel', 125 cat: 'toplevel',
126 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 126 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
127 start: 9000, 127 start: 9000,
128 duration: 10, 128 duration: 10,
129 })); 129 }));
130 }); 130 });
131 let values = new tr.v.HistogramSet(); 131 let values = new tr.v.HistogramSet();
132 tr.metrics.sh.estimatedInputLatency(values, model); 132 tr.metrics.sh.expectedQueueingTimeMetric(values, model);
133 let interactiveEQT = values.getHistogramNamed( 133 let interactiveEQT = values.getHistogramNamed(
134 'interactive:500ms_window:renderer_eqt'); 134 'interactive:500ms_window:renderer_eqt');
135 // TODO(ulan): Support multiple interactive time windows when 135 // TODO(ulan): Support multiple interactive time windows when
136 // https://crbug.com/692112 is fixed. 136 // https://crbug.com/692112 is fixed.
137 assert.equal(0, interactiveEQT.numValues); 137 assert.equal(0, interactiveEQT.numValues);
138 }); 138 });
139 139
140 test('estimatedInputLatency_multipleRenderersAggregates', function() { 140 test('expectedQueueingTime_multipleRenderersAggregates', function() {
141 let model = tr.c.TestUtils.newModel(function(model) { 141 let model = tr.c.TestUtils.newModel(function(model) {
142 let rendererProcess = model.getOrCreateProcess(1984); 142 let rendererProcess = model.getOrCreateProcess(1984);
143 let mainThread = rendererProcess.getOrCreateThread(2); 143 let mainThread = rendererProcess.getOrCreateThread(2);
144 mainThread.name = 'CrRendererMain'; 144 mainThread.name = 'CrRendererMain';
145 addInteractiveTimestamp(rendererProcess, mainThread, 200); 145 addInteractiveTimestamp(rendererProcess, mainThread, 200);
146 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 146 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
147 cat: 'toplevel', 147 cat: 'toplevel',
148 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 148 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
149 start: 0, 149 start: 0,
150 duration: 100, 150 duration: 100,
(...skipping 15 matching lines...) Expand all
166 mainThread2.name = 'CrRendererMain'; 166 mainThread2.name = 'CrRendererMain';
167 addInteractiveTimestamp(rendererProcess2, mainThread2, 200); 167 addInteractiveTimestamp(rendererProcess2, mainThread2, 200);
168 mainThread2.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({ 168 mainThread2.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
169 cat: 'toplevel', 169 cat: 'toplevel',
170 title: 'TaskQueueManager::ProcessTaskFromWorkQueue', 170 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
171 start: 9000, 171 start: 9000,
172 duration: 0, 172 duration: 0,
173 })); 173 }));
174 }); 174 });
175 let values = new tr.v.HistogramSet(); 175 let values = new tr.v.HistogramSet();
176 tr.metrics.sh.estimatedInputLatency(values, model); 176 tr.metrics.sh.expectedQueueingTimeMetric(values, model);
177 let eqt = values.getHistogramNamed( 177 let eqt = values.getHistogramNamed(
178 'interactive:500ms_window:renderer_eqt'); 178 'interactive:500ms_window:renderer_eqt');
179 assert.equal(0.05, eqt.average); 179 assert.equal(0.05, eqt.average);
180 }); 180 });
181
182 test('contributionToExpectedQueueingTime', function() {
183 let model = tr.c.TestUtils.newModel((model) => {
184 let rendererProcess = model.getOrCreateProcess(1984);
185 let mainThread = rendererProcess.getOrCreateThread(2);
186 mainThread.name = 'CrRendererMain';
187 addInteractiveTimestamp(rendererProcess, mainThread, 200);
188 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
189 cat: 'toplevel',
190 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
191 start: 0,
192 duration: 100,
193 }));
194 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
195 cat: 'v8',
196 title: 'V8.GCFinalizeMC',
197 start: 50,
198 duration: 50,
199 }));
200 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
201 cat: 'toplevel',
202 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
203 start: 3000,
204 duration: 10,
205 }));
206 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
207 cat: 'v8',
208 title: 'V8.GCFinalizeMC',
209 start: 3000,
210 duration: 5,
211 }));
212 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
213 cat: 'toplevel',
214 title: 'TaskQueueManager::ProcessTaskFromWorkQueue',
215 start: 9000,
216 duration: 10,
217 }));
218 mainThread.sliceGroup.pushSlice(tr.c.TestUtils.newSliceEx({
219 cat: 'v8',
220 title: 'V8.GCFinalizeMC',
221 start: 9000,
222 duration: 5,
223 }));
224 mainThread.sliceGroup.createSubSlices();
225 });
226 let values = new tr.v.HistogramSet();
227 tr.metrics.sh.contributionToExpectedQueueingTime(
228 (event => event.title === 'V8.GCFinalizeMC'), 'v8:gc',
229 values, model);
230 let interactiveEQT = values.getHistogramNamed(
231 'interactive:500ms_window:renderer_eqt:v8:gc');
232 assert.equal(0.025, interactiveEQT.average);
233 let totalEQT = values.getHistogramNamed(
234 'total:500ms_window:renderer_eqt:v8:gc');
235 assert.equal(2.5, totalEQT.average);
236 });
181 }); 237 });
182 </script> 238 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/metrics/system_health/estimated_input_latency_metric.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698