| Index: perf_insights/perf_insights/mappers/weather_report_map_function.html
|
| diff --git a/perf_insights/perf_insights/mappers/weather_report_map_function.html b/perf_insights/perf_insights/mappers/weather_report_map_function.html
|
| deleted file mode 100644
|
| index bcbb7239b671e8db6200a7e6a09db86cf196248a..0000000000000000000000000000000000000000
|
| --- a/perf_insights/perf_insights/mappers/weather_report_map_function.html
|
| +++ /dev/null
|
| @@ -1,103 +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/function_handle.html">
|
| -<link rel="import" href="/perf_insights/mappers/slice_cost.html">
|
| -<link rel="import" href="/perf_insights/mappers/thread_grouping.html">
|
| -<link rel="import" href="/tracing/base/iteration_helpers.html">
|
| -<link rel="import" href="/tracing/model/user_model/user_expectation.html">
|
| -<link rel="import"
|
| - href="/tracing/metrics/system_health/system_health_metric.html">
|
| -<link rel="import" href="/tracing/model/ir_coverage.html">
|
| -
|
| -<script>
|
| -'use strict';
|
| -
|
| -tr.exportTo('pi.m', function() {
|
| -
|
| - function getWeatherReportFromModel(model) {
|
| - // Organize all UserExpectations by type and name in a tree. A node of this
|
| - // tree is a dict with keys |overallScore|, |scores| and optionally
|
| - // |subTypes|. |overallScore| and |scores| are mutually exclusive. If
|
| - // |overallScore| is present it contains the overall system health score of
|
| - // all IRs under the tree. If |scores| is present it contains an array with
|
| - // the IR scores of all the IRs under the tree. |subTypes| is a map from a
|
| - // subType (IR type, IR name) to a node.
|
| - var irTree = {
|
| - overallScore: 0
|
| - };
|
| - var allIRs = [];
|
| - function addIRToNode(node, ir, path) {
|
| - if (node.overallScore === undefined) {
|
| - // For a node without system health score keep the individual IR scores.
|
| - node.irScores = node.irScores || [];
|
| - node.irScores.push(tr.metrics.sh.SystemHealthMetric.forExpectation(ir));
|
| - }
|
| - if (path.length === 0)
|
| - return;
|
| - var subType = path[0];
|
| - node.subTypes = node.subTypes || {};
|
| - node.subTypes[subType] = node.subTypes[subType] || {};
|
| - addIRToNode(node.subTypes[subType], ir, path.slice(1));
|
| - }
|
| - model.userModel.expectations.forEach(function(ir) {
|
| - if (!(ir instanceof tr.model.um.UserExpectation))
|
| - return;
|
| - allIRs.push(ir);
|
| - var path = [
|
| - ir.stageTitle,
|
| - ir.initiatorTitle || 'Unnamed'
|
| - ];
|
| - addIRToNode(irTree, ir, path);
|
| - });
|
| - irTree.overallScore = tr.metrics.sh.SystemHealthMetric.forModel(model);
|
| -
|
| - var stageTitleByGUID = getStageTitleForEventsByGUID(model, allIRs);
|
| - var threadGrouping = new pi.m.ThreadGrouping();
|
| - threadGrouping.autoInitUsingHelpers(model);
|
| -
|
| - var wr = {
|
| - canonicalUrl: model.canonicalUrlThatCreatedThisTrace,
|
| - irTree: irTree,
|
| - irCoverage: tr.model.getIRCoverageFromModel(model),
|
| - sliceCosts: pi.m.getSliceCostReport(model, threadGrouping,
|
| - stageTitleByGUID)
|
| - };
|
| - return wr;
|
| - }
|
| -
|
| - function getStageTitleForEventsByGUID(model, expectations) {
|
| - var stageTitleByGUID = {};
|
| - expectations.forEach(function applyAssociatedToRTN(ir) {
|
| - ir.associatedEvents.forEach(function applyEventToRTN(event) {
|
| - // Unassociated events have already been assigned to a RTN.
|
| - if (stageTitleByGUID[event.guid] !== undefined)
|
| - return;
|
| - stageTitleByGUID[event.guid] = ir.stageTitle;
|
| - }, this);
|
| - }, this);
|
| -
|
| - model.iterateAllEvents(function storeEventToUnassociatedSet(event) {
|
| - if (stageTitleByGUID[event.guid] !== undefined)
|
| - return;
|
| - stageTitleByGUID[event.guid] = 'Unknown';
|
| - });
|
| - return stageTitleByGUID;
|
| - }
|
| -
|
| - function weatherReportMapFunction(result, model) {
|
| - var wr = pi.m.getWeatherReportFromModel(model);
|
| - result.addPair('wr', wr);
|
| - }
|
| - pi.FunctionRegistry.register(weatherReportMapFunction);
|
| -
|
| - return {
|
| - getWeatherReportFromModel: getWeatherReportFromModel,
|
| - weatherReportMapFunction: weatherReportMapFunction
|
| - };
|
| -});
|
| -
|
| -</script>
|
|
|