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

Unified Diff: perf_insights/perf_insights/ui/reports/rail_score_report.html

Issue 1772833002: Remove SystemHealthMetric (fka RAILScore) (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: fix pi test Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: perf_insights/perf_insights/ui/reports/rail_score_report.html
diff --git a/perf_insights/perf_insights/ui/reports/rail_score_report.html b/perf_insights/perf_insights/ui/reports/rail_score_report.html
deleted file mode 100644
index 73056a7789ebad6d05296fa4652ad8a470dd24c0..0000000000000000000000000000000000000000
--- a/perf_insights/perf_insights/ui/reports/rail_score_report.html
+++ /dev/null
@@ -1,200 +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/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/ui/base/dom_helpers.html">
-<link rel="import" href="/tracing/ui/base/grouping_table.html">
-<link rel="import" href="/tracing/ui/base/info_bar_group.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/numeric.html">
-<link rel="import" href="/tracing/value/ui/histogram_span.html">
-<link rel="import" href="/tracing/value/ui/scalar_span.html">
-<link rel="import" href="/tracing/value/unit.html">
-
-<polymer-element name="pi-ui-r-rail-score-report"
- extends="pi-ui-r-pi-report"
- map-function-href="/perf_insights/mappers/weather_report_map_function.html"
- map-function-name="weatherReportMapFunction">
- <template>
- <style>
- :host {
- display: flex;
- flex-direction: column;
- }
- #histogram {
- flex: 1 1 auto;
- max-width: 400px;
- }
- #links {
- min-height: 200px;
- }
- h2 {
- font-size: 12pt;
- }
- </style>
- <tr-ui-b-table id="table"></tr-ui-b-table>
-
- <h2>Score Histogram</h2>
- <tr-v-ui-histogram-span id="histogram"></tr-v-ui-histogram-span>
-
- <h2>Matching Traces</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);
- },
-
- get mapResults() {
- return this.mapResults_;
- },
-
- set mapResults(mapResults) {
- this.mapResults_ = mapResults;
- this.updateContents_();
- },
-
- updateContents_: function() {
- var results = this.mapResults_;
- if (!results)
- results = [];
-
- var table = this.$.table;
-
- var columns = this.createColumns_();
- table.tableColumns = columns;
- table.sortColumnIndex = 0;
- table.sortDescending = false;
- table.selectionMode = tr.ui.b.TableFormat.SelectionMode.ROW;
-
- var railScoreHistograms = {};
- results.map(function(r) {
- var wr = r.pairs.wr;
- var canonicalUrl = wr.canonicalUrl;
- if (!wr.irTree)
- return;
- this.addToHistograms_(railScoreHistograms, wr.irTree,
- canonicalUrl);
- }.bind(this));
-
- if (!railScoreHistograms.histogram)
- return;
-
- var overallRow = this.convertToRowAndSubRows_(railScoreHistograms);
- overallRow.title = 'Overall RAIL score';
- table.tableRows = [overallRow];
- table.selectedTableRow = overallRow;
- 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'
- },
- {
- title: 'Avg. RAIL score',
- textAlign: 'right',
- value: function(row) {
- return tr.v.ui.createScalarSpan(
- new tr.v.ScalarNumeric(tr.v.Unit.byName.normalizedPercentage,
- row.histogram.average));
- },
- cmp: function(a, b) {
- return a.histogram.average - b.histogram.average;
- }
- }
- ];
- return columns;
- },
-
- addToHistograms_: function(histograms, irTree, sourceInfo) {
- histograms.histogram = histograms.histogram ||
- tr.v.Histogram.createLinear(
- tr.v.Unit.byName.normalizedPercentage,
- tr.b.Range.fromExplicitRange(0, 1),
- 33);
- if (irTree.overallScore !== undefined)
- histograms.histogram.add(irTree.overallScore, sourceInfo);
- if (irTree.irScores) {
- irTree.irScores.forEach(function(irScore) {
- histograms.histogram.add(irScore, sourceInfo);
- });
- }
- if (!irTree.subTypes)
- return;
- histograms.subTypes = histograms.subTypes || {};
- for (var subType in irTree.subTypes) {
- histograms.subTypes[subType] = histograms.subTypes[subType] || {};
- this.addToHistograms_(histograms.subTypes[subType],
- irTree.subTypes[subType], sourceInfo);
- }
- },
-
- convertToRowAndSubRows_: function(histograms) {
- var row = {
- histogram: histograms.histogram
- };
- if (!histograms.subTypes)
- return row;
- row.isExpanded = true;
- row.subRows = [];
- for (var subType in histograms.subTypes) {
- var subRow = this.convertToRowAndSubRows_(histograms.subTypes[subType]);
- subRow.title = subType;
- row.subRows.push(subRow);
- }
- return row;
- },
-
- setTraceURLsFromBins_: function(bins) {
- var urlSet = [];
- bins.forEach(function(bin) {
- bin.sourceInfos.forEach(function(sourceInfo) {
- urlSet[sourceInfo] = 1;
- });
- });
- urlSet = Object.keys(urlSet);
- urlSet.sort();
- this.$.links.setTraceUrls(urlSet);
- },
-
- setHistogramBasedOnSelection_: function() {
- this.$.histogram.histogram = this.$.table.selectedTableRow.histogram;
- this.setTraceURLsFromBins_(this.$.histogram.histogram.allBins);
- }
- });
- </script>
-</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698