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

Unified Diff: perf_insights/perf_insights/timeline_based_measurement/rendering_frame.html

Issue 1685683003: Implement Timeline Based Measurement v2 (Closed) Base URL: git@github.com:catapult-project/catapult.git@new_style_results
Patch Set: fix vinn tests Created 4 years, 10 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
« no previous file with comments | « no previous file | perf_insights/perf_insights/timeline_based_measurement/rendering_frame_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: perf_insights/perf_insights/timeline_based_measurement/rendering_frame.html
diff --git a/perf_insights/perf_insights/timeline_based_measurement/rendering_frame.html b/perf_insights/perf_insights/timeline_based_measurement/rendering_frame.html
deleted file mode 100644
index 21e1a4bd0a07c2e0bf8f228d3587f088ef4ebfc3..0000000000000000000000000000000000000000
--- a/perf_insights/perf_insights/timeline_based_measurement/rendering_frame.html
+++ /dev/null
@@ -1,116 +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="/tracing/base/range.html">
-<link rel="import" href="/tracing/extras/chrome/cc/constants.html">
-<link rel="import" href="/tracing/model/slice.html">
-
-<script>
-'use strict';
-
-tr.exportTo('pi.tbm', function() {
-
- var SEND_BEGIN_FRAME_EVENT = tr.e.cc.constants.SEND_BEGIN_FRAME_EVENT;
- var BEGIN_MAIN_FRAME_EVENT = tr.e.cc.constants.BEGIN_MAIN_FRAME_EVENT;
-
- /* Object with info about the triggering of a BeginMainFrame event.
- * Do not construct this directly. Use RenderingFrame.fromEvents instead.
- */
- function RenderingFrame(sendBeginFrame, beginMainFrame) {
- this.sendBeginFrame_ = sendBeginFrame;
- this.beginMainFrame_ = beginMainFrame;
-
- this.range_ = new tr.b.Range();
- this.beginMainFrame_.addBoundsToRange(this.range_);
- this.sendBeginFrame_.addBoundsToRange(this.range_);
- }
-
- /**
- * Construct RenderingFrame from a list of events.
- * Return undefined if data are missing.
- */
- function createRenderingFrameFromEvents(events) {
- var allSendBeginFrameEvents = events.filter(function(e) {
- return e.title === SEND_BEGIN_FRAME_EVENT;
- });
- if (allSendBeginFrameEvents.length !== 1)
- return undefined;
-
- var allBeginMainFrameEvents = events.filter(function(e) {
- return e.title === BEGIN_MAIN_FRAME_EVENT;
- });
- if (allBeginMainFrameEvents.length === 0)
- return undefined;
-
- allBeginMainFrameEvents.sort(function(a, b) {
- return a.start - b.start;
- });
- return new RenderingFrame(
- allSendBeginFrameEvents[0],
- allBeginMainFrameEvents[allBeginMainFrameEvents.length - 1]);
- }
-
- RenderingFrame.prototype = {
- get range() {
- return this.range_;
- },
-
- get queueDuration() {
- return this.beginMainFrame_.start - this.sendBeginFrame_.start;
- }
- };
-
- /* Returns RenderingFrames for all relevant events in the timelineRange. */
- RenderingFrame.getFrameEventsInsideRange = function(
- rendererProcess, timelineRange) {
- if (!(timelineRange instanceof tr.b.Range))
- throw new Error('timelineRange must is Range object');
- // First filter all events from the rendererProcess and turn them into a
- // dictonary from event ids -> events objects that are either
- // send_begin_frame or begin_main_frame event.
- // e.g:
- // {132: [send_begin_frame, begin_main_frame, begin_main_frame],
- // 213: [begin_main_frame, send_begin_frame],
- // 9312: [send_begin_frame, begin_main_frame]}
- var beginFrameEventsById = {};
- rendererProcess.iterateAllEvents(function(event) {
- var beginFrameId;
- if (event instanceof tr.model.Slice &&
- (event.title === SEND_BEGIN_FRAME_EVENT ||
- event.title === BEGIN_MAIN_FRAME_EVENT)) {
- beginFrameId = event.args['begin_frame_id'];
- if (beginFrameId === undefined) {
- throw new Error(
- 'Event is missing a beginFrameId.');
- }
- }
- beginFrameEventsById[beginFrameId] =
- beginFrameEventsById[beginFrameId] || [];
- beginFrameEventsById[beginFrameId].push(event);
- });
-
- // Now, create RenderingFrames for events wherever possible.
- var frames = [];
- for (var id in beginFrameEventsById) {
- var events = beginFrameEventsById[id];
- var frame = createRenderingFrameFromEvents(events);
- if (frame === undefined)
- continue;
- if (frame.range.intersectsRangeInclusive(timelineRange))
- frames.push(frame);
- frames.sort(function(a, b) {
- return a.range.min - b.range.min;
- });
- }
-
- return frames;
- }
-
- return {
- RenderingFrame: RenderingFrame
- };
-});
-</script>
« no previous file with comments | « no previous file | perf_insights/perf_insights/timeline_based_measurement/rendering_frame_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698