1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.web_perf.metrics.smoothness</title> 4<meta charset="utf-8"> 5</head><body bgcolor="#f0f0f8"> 6 7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 8<tr bgcolor="#7799ee"> 9<td valign=bottom> <br> 10<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.web_perf.html"><font color="#ffffff">web_perf</font></a>.<a href="telemetry.web_perf.metrics.html"><font color="#ffffff">metrics</font></a>.smoothness</strong></big></big></font></td 11><td align=right valign=bottom 12><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/web_perf/metrics/smoothness.py">telemetry/web_perf/metrics/smoothness.py</a></font></td></tr></table> 13 <p><tt># Copyright 2014 The Chromium Authors. All rights reserved.<br> 14# Use of this source code is governed by a BSD-style license that can be<br> 15# found in the LICENSE file.</tt></p> 16<p> 17<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 18<tr bgcolor="#aa55cc"> 19<td colspan=3 valign=bottom> <br> 20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 21 22<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 23<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.value.improvement_direction.html">telemetry.value.improvement_direction</a><br> 24<a href="telemetry.value.list_of_scalar_values.html">telemetry.value.list_of_scalar_values</a><br> 25</td><td width="25%" valign=top><a href="logging.html">logging</a><br> 26<a href="telemetry.util.perf_tests_helper.html">telemetry.util.perf_tests_helper</a><br> 27</td><td width="25%" valign=top><a href="telemetry.web_perf.metrics.rendering_stats.html">telemetry.web_perf.metrics.rendering_stats</a><br> 28<a href="telemetry.value.scalar.html">telemetry.value.scalar</a><br> 29</td><td width="25%" valign=top><a href="telemetry.util.statistics.html">telemetry.util.statistics</a><br> 30<a href="telemetry.web_perf.metrics.timeline_based_metric.html">telemetry.web_perf.metrics.timeline_based_metric</a><br> 31</td></tr></table></td></tr></table><p> 32<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 33<tr bgcolor="#ee77aa"> 34<td colspan=3 valign=bottom> <br> 35<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 36 37<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 38<td width="100%"><dl> 39<dt><font face="helvetica, arial"><a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 40</font></dt><dd> 41<dl> 42<dt><font face="helvetica, arial"><a href="telemetry.web_perf.metrics.smoothness.html#SmoothnessMetric">SmoothnessMetric</a> 43</font></dt></dl> 44</dd> 45</dl> 46 <p> 47<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 48<tr bgcolor="#ffc8d8"> 49<td colspan=3 valign=bottom> <br> 50<font color="#000000" face="helvetica, arial"><a name="SmoothnessMetric">class <strong>SmoothnessMetric</strong></a>(<a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a>)</font></td></tr> 51 52<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 53<td colspan=2><tt>Computes metrics that measure smoothness of animations over given ranges.<br> 54 <br> 55Animations are typically considered smooth if the frame rates are close to<br> 5660 frames per second (fps) and uniformly distributed over the sequence. To<br> 57determine if a timeline range contains a smooth animation, we update the<br> 58results object with several representative metrics:<br> 59 <br> 60 frame_times: A list of raw frame times<br> 61 mean_frame_time: The arithmetic mean of frame times<br> 62 percentage_smooth: Percentage of frames that were hitting 60 FPS.<br> 63 frame_time_discrepancy: The absolute discrepancy of frame timestamps<br> 64 mean_pixels_approximated: The mean percentage of pixels approximated<br> 65 queueing_durations: The queueing delay between compositor & main threads<br> 66 <br> 67Note that if any of the interaction records provided to AddResults have less<br> 68than 2 frames, we will return telemetry values with None values for each of<br> 69the smoothness metrics. Similarly, older browsers without support for<br> 70tracking the BeginMainFrame events will report a ListOfScalarValues with a<br> 71None value for the queueing duration metric.<br> </tt></td></tr> 72<tr><td> </td> 73<td width="100%"><dl><dt>Method resolution order:</dt> 74<dd><a href="telemetry.web_perf.metrics.smoothness.html#SmoothnessMetric">SmoothnessMetric</a></dd> 75<dd><a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a></dd> 76<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 77</dl> 78<hr> 79Methods defined here:<br> 80<dl><dt><a name="SmoothnessMetric-AddResults"><strong>AddResults</strong></a>(self, model, renderer_thread, interaction_records, results)</dt></dl> 81 82<dl><dt><a name="SmoothnessMetric-__init__"><strong>__init__</strong></a>(self)</dt></dl> 83 84<hr> 85Methods inherited from <a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a>:<br> 86<dl><dt><a name="SmoothnessMetric-AddWholeTraceResults"><strong>AddWholeTraceResults</strong></a>(self, model, results)</dt><dd><tt>Computes and adds metrics corresponding to the entire trace.<br> 87 <br> 88Override this method to compute results that correspond to the whole trace.<br> 89 <br> 90Args:<br> 91 model: An instance of telemetry.timeline.model.TimelineModel.<br> 92 results: An instance of page.PageTestResults.</tt></dd></dl> 93 94<dl><dt><a name="SmoothnessMetric-VerifyNonOverlappedRecords"><strong>VerifyNonOverlappedRecords</strong></a>(self, interaction_records)</dt><dd><tt>This raises exceptions if interaction_records contain overlapped ranges.</tt></dd></dl> 95 96<hr> 97Data descriptors inherited from <a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a>:<br> 98<dl><dt><strong>__dict__</strong></dt> 99<dd><tt>dictionary for instance variables (if defined)</tt></dd> 100</dl> 101<dl><dt><strong>__weakref__</strong></dt> 102<dd><tt>list of weak references to the object (if defined)</tt></dd> 103</dl> 104</td></tr></table></td></tr></table><p> 105<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 106<tr bgcolor="#55aa55"> 107<td colspan=3 valign=bottom> <br> 108<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> 109 110<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> 111<td width="100%"><strong>NOT_ENOUGH_FRAMES_MESSAGE</strong> = "Not enough frames for smoothness metrics (at lea...der extremely slow<font color="#c040c0">\n</font>- Pages that can't be scrolled"</td></tr></table> 112</body></html>