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>&nbsp;<br>
10<font color="#ffffff" face="helvetica, arial">&nbsp;<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>#&nbsp;Copyright&nbsp;2014&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
14#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
15#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;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>&nbsp;<br>
20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
21
22<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<br>
35<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
36
37<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td>
53<td colspan=2><tt>Computes&nbsp;metrics&nbsp;that&nbsp;measure&nbsp;smoothness&nbsp;of&nbsp;animations&nbsp;over&nbsp;given&nbsp;ranges.<br>
54&nbsp;<br>
55Animations&nbsp;are&nbsp;typically&nbsp;considered&nbsp;smooth&nbsp;if&nbsp;the&nbsp;frame&nbsp;rates&nbsp;are&nbsp;close&nbsp;to<br>
5660&nbsp;frames&nbsp;per&nbsp;second&nbsp;(fps)&nbsp;and&nbsp;uniformly&nbsp;distributed&nbsp;over&nbsp;the&nbsp;sequence.&nbsp;To<br>
57determine&nbsp;if&nbsp;a&nbsp;timeline&nbsp;range&nbsp;contains&nbsp;a&nbsp;smooth&nbsp;animation,&nbsp;we&nbsp;update&nbsp;the<br>
58results&nbsp;object&nbsp;with&nbsp;several&nbsp;representative&nbsp;metrics:<br>
59&nbsp;<br>
60&nbsp;&nbsp;frame_times:&nbsp;A&nbsp;list&nbsp;of&nbsp;raw&nbsp;frame&nbsp;times<br>
61&nbsp;&nbsp;mean_frame_time:&nbsp;The&nbsp;arithmetic&nbsp;mean&nbsp;of&nbsp;frame&nbsp;times<br>
62&nbsp;&nbsp;percentage_smooth:&nbsp;Percentage&nbsp;of&nbsp;frames&nbsp;that&nbsp;were&nbsp;hitting&nbsp;60&nbsp;FPS.<br>
63&nbsp;&nbsp;frame_time_discrepancy:&nbsp;The&nbsp;absolute&nbsp;discrepancy&nbsp;of&nbsp;frame&nbsp;timestamps<br>
64&nbsp;&nbsp;mean_pixels_approximated:&nbsp;The&nbsp;mean&nbsp;percentage&nbsp;of&nbsp;pixels&nbsp;approximated<br>
65&nbsp;&nbsp;queueing_durations:&nbsp;The&nbsp;queueing&nbsp;delay&nbsp;between&nbsp;compositor&nbsp;&amp;&nbsp;main&nbsp;threads<br>
66&nbsp;<br>
67Note&nbsp;that&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;interaction&nbsp;records&nbsp;provided&nbsp;to&nbsp;AddResults&nbsp;have&nbsp;less<br>
68than&nbsp;2&nbsp;frames,&nbsp;we&nbsp;will&nbsp;return&nbsp;telemetry&nbsp;values&nbsp;with&nbsp;None&nbsp;values&nbsp;for&nbsp;each&nbsp;of<br>
69the&nbsp;smoothness&nbsp;metrics.&nbsp;Similarly,&nbsp;older&nbsp;browsers&nbsp;without&nbsp;support&nbsp;for<br>
70tracking&nbsp;the&nbsp;BeginMainFrame&nbsp;events&nbsp;will&nbsp;report&nbsp;a&nbsp;ListOfScalarValues&nbsp;with&nbsp;a<br>
71None&nbsp;value&nbsp;for&nbsp;the&nbsp;queueing&nbsp;duration&nbsp;metric.<br>&nbsp;</tt></td></tr>
72<tr><td>&nbsp;</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&nbsp;and&nbsp;adds&nbsp;metrics&nbsp;corresponding&nbsp;to&nbsp;the&nbsp;entire&nbsp;trace.<br>
87&nbsp;<br>
88Override&nbsp;this&nbsp;method&nbsp;to&nbsp;compute&nbsp;results&nbsp;that&nbsp;correspond&nbsp;to&nbsp;the&nbsp;whole&nbsp;trace.<br>
89&nbsp;<br>
90Args:<br>
91&nbsp;&nbsp;model:&nbsp;An&nbsp;instance&nbsp;of&nbsp;telemetry.timeline.model.TimelineModel.<br>
92&nbsp;&nbsp;results:&nbsp;An&nbsp;instance&nbsp;of&nbsp;page.PageTestResults.</tt></dd></dl>
93
94<dl><dt><a name="SmoothnessMetric-VerifyNonOverlappedRecords"><strong>VerifyNonOverlappedRecords</strong></a>(self, interaction_records)</dt><dd><tt>This&nbsp;raises&nbsp;exceptions&nbsp;if&nbsp;interaction_records&nbsp;contain&nbsp;overlapped&nbsp;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&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
100</dl>
101<dl><dt><strong>__weakref__</strong></dt>
102<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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>&nbsp;<br>
108<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
109
110<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>