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

Side by Side Diff: perf_insights/perf_insights/mappers/trace_import_cost.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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 (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
8 <link rel="import" href="/perf_insights/mappers/reduce.html">
9 <link rel="import" href="/perf_insights/mre/function_handle.html">
10 <link rel="import" href="/tracing/extras/measure/measure.html">
11 <link rel="import" href="/tracing/model/async_slice_group.html">
12
13 <script>
14 'use strict';
15 tr.exportTo('pi.m', function() {
16 var MeasureAsyncSlice = tr.e.measure.MeasureAsyncSlice;
17
18 function fetchSlicesInfo(slice, cost_infos) {
19 var cost_info = {
20 args: slice.args,
21 title: slice.originalTitle,
22 start: slice.start,
23 duration: slice.duration,
24 subSlices: []
25 };
26 cost_infos.push(cost_info);
27 var subSlices = slice.subSlices;
28 for (var i = 0; i < subSlices.length; ++i) {
29 fetchSlicesInfo(subSlices[i], cost_info.subSlices);
30 }
31 }
32
33 function getTraceImportCostReport(result, model) {
34 var top_level_slices = [];
35 model.iterateAllEvents(function(event) {
36 if (event instanceof MeasureAsyncSlice &&
37 event.viewSubGroupTitle === 'TraceImport' &&
38 event.isTopLevel) {
39 top_level_slices.push(event);
40 }
41 });
42 var traceImportCostInfos = [];
43 for (var i = 0; i < top_level_slices.length; ++i) {
44 fetchSlicesInfo(top_level_slices[i], traceImportCostInfos);
45 }
46
47 result.addPair('trace_import_cost_info',
48 {'slices': traceImportCostInfos});
49 }
50
51 pi.FunctionRegistry.register(getTraceImportCostReport);
52
53 return {
54 getTraceImportCostReport: getTraceImportCostReport
55 };
56 });
57 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698