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

Side by Side Diff: perf_insights/perf_insights_examples/map_startup_info.html

Issue 1290323003: Create a mapper to compute browser and renderer startup durations. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Rebased. Created 5 years, 4 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 | 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
(Empty)
1 <!DOCTYPE HTML>
2 <!--
3 Copyright (c) 2015 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 <link rel="import" href="/perf_insights/value/value.html">
8 <link rel="import" href="/perf_insights/map_function.html">
9
10 <script>
11 tr.exportTo('pie', function() {
12 function getProcessName(event) {
nduca 2015/08/14 20:29:31 driveby thought, nonblocking: should we be making
beaudoin 2015/08/14 22:10:41 Did something. It's a bit far reaching but I think
13 if (event && event.parentContainer && event.parentContainer.parent)
14 return event.parentContainer.parent.name;
15 }
16
17 function mapProcessCount(results, run_info, model) {
18 var startupIRs = model.interaction_records.filter(function(ir) {
19 return ir instanceof tr.e.rail.LoadInteractionRecord &&
nduca 2015/08/14 20:29:31 can you have the title of the LoadInteractionRecor
beaudoin 2015/08/14 22:10:41 I now have a 'name' field on the all IRs. This was
20 ir.args['name'] && ir.args['name'] === 'Startup';
21 });
22 // Find the Startup IR in the browser process, there should only be 1.
23 var browser_begin;
24 var browser_end;
25 var renderer_begin;
26 var renderer_end;
27 startupIRs.forEach(function(ir) {
28 ir.associatedEvents.toArray().forEach(function(event) {
29 var processName = getProcessName(event);
nduca 2015/08/14 20:29:31 can you somehow use chrome model helper here? e.g
beaudoin 2015/08/14 22:10:41 Done.
30 if (processName === 'Browser') {
31 browser_begin = Math.min(event.start, browser_begin || event.start);
nduca 2015/08/14 20:29:32 can you use tr.b.Range for this?
beaudoin 2015/08/14 22:10:41 OMG! I SEE THE LIGHT! Done.
32 var end = event.start + event.duration;
33 browser_end = Math.max(end, browser_end || end);
34 }
35 if (processName === 'Renderer') {
36 renderer_begin = Math.min(event.start, renderer_begin || event.start);
37 var end = event.start + event.duration;
38 renderer_end = Math.max(end, renderer_end || end);
39 }
40 });
41 });
42
43 var startupInfo = {};
44 if (browser_begin !== undefined && browser_end !== undefined)
nduca 2015/08/14 20:29:31 if you used ranges, you'd say if (range.isEmpty) r
beaudoin 2015/08/14 22:10:41 Problem went away...
45 startupInfo['browserStartupDuration'] = browser_end - browser_begin;
46 if (renderer_begin !== undefined && renderer_end !== undefined)
47 startupInfo['rendererStartupDuration'] = renderer_end - renderer_begin;
48
49 results.addValue(new pi.v.DictValue(
50 run_info,
51 'startup_info', startupInfo));
52 }
53
54 pi.MapFunction.register(mapProcessCount);
55
56 return {
57 mapProcessCount: mapProcessCount
nduca 2015/08/14 20:29:32 name the function differently plox?
beaudoin 2015/08/14 22:10:41 Done.
58 };
59 });
60 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698