| Index: perf_insights/perf_insights/ui/reports/task_info_report.html
|
| diff --git a/perf_insights/perf_insights/ui/reports/task_info_report.html b/perf_insights/perf_insights/ui/reports/task_info_report.html
|
| deleted file mode 100644
|
| index 2fe4a593b1cb9a94301afe3c94e97f01e3f10166..0000000000000000000000000000000000000000
|
| --- a/perf_insights/perf_insights/ui/reports/task_info_report.html
|
| +++ /dev/null
|
| @@ -1,218 +0,0 @@
|
| -<!DOCTYPE html>
|
| -<!--
|
| -Copyright (c) 2015 The Chromium Authors. All rights reserved.
|
| -Use of this source code is governed by a BSD-style license that can be
|
| -found in the LICENSE file.
|
| --->
|
| -<link rel="import" href="/perf_insights/mappers/reduce.html">
|
| -<link rel="import" href="/perf_insights/mappers/slice_cost.html">
|
| -<link rel="import" href="/perf_insights/ui/caching_column.html">
|
| -<link rel="import" href="/perf_insights/ui/reports/pi_report.html">
|
| -<link rel="import" href="/perf_insights/ui/trace_link_list.html">
|
| -<link rel="import" href="/tracing/base/iteration_helpers.html">
|
| -<link rel="import" href="/tracing/ui/base/dom_helpers.html">
|
| -<link rel="import" href="/tracing/ui/base/grouping_table.html">
|
| -<link rel="import" href="/tracing/ui/base/overlay.html">
|
| -<link rel="import" href="/tracing/ui/base/table.html">
|
| -<link rel="import" href="/tracing/value/histogram.html">
|
| -<link rel="import" href="/tracing/value/ui/histogram_span.html">
|
| -<link rel="import" href="/tracing/value/ui/time_duration_span.html">
|
| -
|
| -<polymer-element name="pi-ui-r-task-info-report"
|
| - extends="pi-ui-r-pi-report"
|
| - map-function-href="/perf_insights/mappers/task_info_map_function.html"
|
| - map-function-name="taskInfoMapFunction">
|
| - <template>
|
| - <style>
|
| - :host {
|
| - display: flex;
|
| - flex-direction: column;
|
| - }
|
| - top-controls {
|
| - display: flex;
|
| - flex: 0 0 auto;
|
| - background-color: rgb(236, 236, 236);
|
| - border-bottom: 1px solid #8e8e8e;
|
| - padding: 4px;
|
| - }
|
| - #histogram {
|
| - flex: 1 1 auto;
|
| - max-width: 400px;
|
| - }
|
| - #links {
|
| - min-height: 200px;
|
| - }
|
| - h2 {
|
| - font-size: 12pt;
|
| - }
|
| - #table {
|
| - flex: 1 1 auto;
|
| - }
|
| - </style>
|
| - <tr-ui-b-grouping-table id="table"></tr-ui-b-grouping-table>
|
| - <h2>Histogram</h2>
|
| - <tr-v-ui-histogram-span id="histogram"></tr-v-ui-histogram-span>
|
| - <h2>Links</h2>
|
| - <pi-ui-trace-link-list id="links"></pi-ui-trace-link-list>
|
| - </template>
|
| - <script>
|
| - 'use strict';
|
| -
|
| - Polymer({
|
| - created: function() {
|
| - this.mapResults_ = undefined;
|
| - },
|
| -
|
| - ready: function() {
|
| - this.$.table.addEventListener('selection-changed',
|
| - function(tableEvent) {
|
| - tableEvent.stopPropagation();
|
| - this.setHistogramBasedOnSelection_();
|
| - }.bind(this));
|
| - var histogram = this.$.histogram;
|
| - histogram.addEventListener('brushed-bins-changed',
|
| - this.onBrushedBinsChanged_.bind(this));
|
| - },
|
| -
|
| - onBrushedBinsChanged_: function(event) {
|
| - event.stopPropagation();
|
| - this.setTraceURLsFromBins_(this.$.histogram.brushedBins);
|
| - },
|
| -
|
| - setTraceURLsFromBins_: function(bins) {
|
| - var urlSet = [];
|
| - bins.forEach(function(bin) {
|
| - bin.sourceInfos.forEach(function(sourceInfo) {
|
| - urlSet[sourceInfo.url] = 1;
|
| - });
|
| - });
|
| - urlSet = Object.keys(urlSet);
|
| - urlSet.sort();
|
| - this.$.links.setTraceUrls(urlSet);
|
| - },
|
| -
|
| - get mapResults() {
|
| - return this.mapResults_;
|
| - },
|
| -
|
| - set mapResults(mapResults) {
|
| - this.mapResults_ = mapResults;
|
| - this.updateContents_();
|
| - },
|
| -
|
| - updateContents_: function() {
|
| - var table = this.$.table;
|
| -
|
| - var results = this.mapResults_;
|
| - if (!results)
|
| - results = [];
|
| -
|
| - var columns = this.createColumns_();
|
| - table.tableColumns = columns;
|
| - table.sortColumnIndex = 3;
|
| - table.sortDescending = true;
|
| -
|
| - var rows = [];
|
| - results.forEach(function(result) {
|
| - tr.b.iterItems(result.pairs, function(name, info) {
|
| - for (var process in info) {
|
| - for (var thread in info[process]) {
|
| - rows.push({
|
| - process: process,
|
| - thread: thread,
|
| - type: name,
|
| - histogram:
|
| - tr.v.Histogram.fromDict(info[process][thread])
|
| - });
|
| - }
|
| - }
|
| - });
|
| - });
|
| -
|
| - var groupBy = [];
|
| - groupBy.push(function(datum) {
|
| - return datum.process;
|
| - });
|
| - groupBy.push(function(datum) {
|
| - return datum.thread;
|
| - });
|
| - table.groupBy = groupBy;
|
| - table.selectionMode = tr.ui.b.TableFormat.SelectionMode.CELL;
|
| - table.dataToGroup = rows;
|
| - table.selectedTableRow = table.tableRows[0];
|
| - table.selectedColumnIndex = 2;
|
| - table.rebuild();
|
| - this.setHistogramBasedOnSelection_();
|
| - },
|
| -
|
| - createColumns_: function() {
|
| - var columns = [{
|
| - title: 'Title',
|
| - value: function(row) {
|
| - return row.title;
|
| - },
|
| - cmp: function(a, b) {
|
| - return a.title.localeCompare(b.title);
|
| - },
|
| - width: '500px'
|
| - },
|
| - this.createCachingColumn_('Avg. Time in queue', 'time_spent_in_queue'),
|
| - this.createCachingColumn_('Avg. Self time',
|
| - 'time_spent_in_top_level_task'),
|
| - this.createCachingColumn_('Avg. CPU time',
|
| - 'cpu_time_spent_in_top_level_task')
|
| - ];
|
| -
|
| - return columns;
|
| - },
|
| -
|
| - createCachingColumn_: function(title, type) {
|
| - function averageFromHistograms(data) {
|
| - var runningSum = 0;
|
| - var numValues = 0;
|
| - data.forEach(function(datum) {
|
| - if (datum.type !== type)
|
| - return;
|
| - runningSum += datum.histogram.runningSum;
|
| - numValues += datum.histogram.numValues;
|
| - });
|
| - var average = 0;
|
| - if (numValues !== 0)
|
| - average = runningSum / numValues;
|
| - return tr.v.ui.createTimeDurationSpan(average);
|
| - }
|
| -
|
| - var column = new pi.ui.CachingColumn(title, averageFromHistograms);
|
| - column.type = type;
|
| - column.textAlign = 'right';
|
| - column.cmp = function(row0, row1) {
|
| - return column.value(row0).duration - column.value(row1).duration;
|
| - };
|
| - return column;
|
| - },
|
| -
|
| - setHistogramBasedOnSelection_: function() {
|
| - var table = this.$.table;
|
| - var selectedColumn = table.selectedColumnIndex;
|
| - // Don't display a histogram if the user selects the title.
|
| - if (selectedColumn === 0)
|
| - return;
|
| -
|
| - var desiredType = table.tableColumns[selectedColumn].type;
|
| - var histogram = undefined;
|
| - table.selectedTableRow.data.forEach(function(datum) {
|
| - if (datum.type !== desiredType)
|
| - return;
|
| - if (!histogram)
|
| - histogram = datum.histogram.clone();
|
| - else
|
| - histogram.addHistogram(datum.histogram);
|
| - });
|
| -
|
| - this.$.histogram.histogram = histogram;
|
| - this.setTraceURLsFromBins_(this.$.histogram.histogram.allBins);
|
| - }
|
| -
|
| - });
|
| - </script>
|
| -</polymer-element>
|
|
|