1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3 <html><head><title>Python: module telemetry.web_perf.metrics.timeline_based_metric</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>.timeline_based_metric</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/timeline_based_metric.py">telemetry/web_perf/metrics/timeline_based_metric.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="#ee77aa"> 19 <td colspan=3 valign=bottom> <br> 20 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 21 22 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 23 <td width="100%"><dl> 24 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 25 </font></dt><dd> 26 <dl> 27 <dt><font face="helvetica, arial"><a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">TimelineBasedMetric</a> 28 </font></dt></dl> 29 </dd> 30 <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) 31 </font></dt><dd> 32 <dl> 33 <dt><font face="helvetica, arial"><a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetricException">TimelineBasedMetricException</a> 34 </font></dt></dl> 35 </dd> 36 </dl> 37 <p> 38 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 39 <tr bgcolor="#ffc8d8"> 40 <td colspan=3 valign=bottom> <br> 41 <font color="#000000" face="helvetica, arial"><a name="TimelineBasedMetric">class <strong>TimelineBasedMetric</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 42 43 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 44 <td width="100%">Methods defined here:<br> 45 <dl><dt><a name="TimelineBasedMetric-AddResults"><strong>AddResults</strong></a>(self, model, renderer_thread, interaction_records, results)</dt><dd><tt>Computes and adds metrics for the interaction_records' time ranges.<br> 46 <br> 47 The override of this method should compute results on the data **only**<br> 48 within the interaction_records' start and end time ranges.<br> 49 <br> 50 Args:<br> 51 model: An instance of telemetry.timeline.model.TimelineModel.<br> 52 interaction_records: A list of instances of TimelineInteractionRecord. If<br> 53 the override of this method doesn't support overlapped ranges, use<br> 54 VerifyNonOverlappedRecords to check that no records are overlapped.<br> 55 results: An instance of page.PageTestResults.</tt></dd></dl> 56 57 <dl><dt><a name="TimelineBasedMetric-AddWholeTraceResults"><strong>AddWholeTraceResults</strong></a>(self, model, results)</dt><dd><tt>Computes and adds metrics corresponding to the entire trace.<br> 58 <br> 59 Override this method to compute results that correspond to the whole trace.<br> 60 <br> 61 Args:<br> 62 model: An instance of telemetry.timeline.model.TimelineModel.<br> 63 results: An instance of page.PageTestResults.</tt></dd></dl> 64 65 <dl><dt><a name="TimelineBasedMetric-VerifyNonOverlappedRecords"><strong>VerifyNonOverlappedRecords</strong></a>(self, interaction_records)</dt><dd><tt>This raises exceptions if interaction_records contain overlapped ranges.</tt></dd></dl> 66 67 <dl><dt><a name="TimelineBasedMetric-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Computes metrics from a telemetry.timeline Model and a range</tt></dd></dl> 68 69 <hr> 70 Data descriptors defined here:<br> 71 <dl><dt><strong>__dict__</strong></dt> 72 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 73 </dl> 74 <dl><dt><strong>__weakref__</strong></dt> 75 <dd><tt>list of weak references to the object (if defined)</tt></dd> 76 </dl> 77 </td></tr></table> <p> 78 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 79 <tr bgcolor="#ffc8d8"> 80 <td colspan=3 valign=bottom> <br> 81 <font color="#000000" face="helvetica, arial"><a name="TimelineBasedMetricException">class <strong>TimelineBasedMetricException</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr> 82 83 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 84 <td colspan=2><tt><a href="exceptions.html#Exception">Exception</a> that can be thrown from metrics that implements<br> 85 <a href="#TimelineBasedMetric">TimelineBasedMetric</a> to indicate a problem arised when computing the metric.<br> </tt></td></tr> 86 <tr><td> </td> 87 <td width="100%"><dl><dt>Method resolution order:</dt> 88 <dd><a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetricException">TimelineBasedMetricException</a></dd> 89 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> 90 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> 91 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 92 </dl> 93 <hr> 94 Data descriptors defined here:<br> 95 <dl><dt><strong>__weakref__</strong></dt> 96 <dd><tt>list of weak references to the object (if defined)</tt></dd> 97 </dl> 98 <hr> 99 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 100 <dl><dt><a name="TimelineBasedMetricException-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#TimelineBasedMetricException-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl> 101 102 <hr> 103 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 104 <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#TimelineBasedMetricException-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> 105 106 <hr> 107 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 108 <dl><dt><a name="TimelineBasedMetricException-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#TimelineBasedMetricException-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> 109 110 <dl><dt><a name="TimelineBasedMetricException-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#TimelineBasedMetricException-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> 111 112 <dl><dt><a name="TimelineBasedMetricException-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#TimelineBasedMetricException-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> 113 114 <dl><dt><a name="TimelineBasedMetricException-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#TimelineBasedMetricException-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> 115 <br> 116 Use of negative indices is not supported.</tt></dd></dl> 117 118 <dl><dt><a name="TimelineBasedMetricException-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> 119 120 <dl><dt><a name="TimelineBasedMetricException-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#TimelineBasedMetricException-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> 121 122 <dl><dt><a name="TimelineBasedMetricException-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#TimelineBasedMetricException-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> 123 124 <dl><dt><a name="TimelineBasedMetricException-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> 125 126 <dl><dt><a name="TimelineBasedMetricException-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#TimelineBasedMetricException-__str__">__str__</a>() <==> str(x)</tt></dd></dl> 127 128 <dl><dt><a name="TimelineBasedMetricException-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> 129 130 <hr> 131 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 132 <dl><dt><strong>__dict__</strong></dt> 133 </dl> 134 <dl><dt><strong>args</strong></dt> 135 </dl> 136 <dl><dt><strong>message</strong></dt> 137 </dl> 138 </td></tr></table></td></tr></table><p> 139 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 140 <tr bgcolor="#eeaa77"> 141 <td colspan=3 valign=bottom> <br> 142 <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> 143 144 <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> 145 <td width="100%"><dl><dt><a name="-IsEventInInteractions"><strong>IsEventInInteractions</strong></a>(event, interaction_records)</dt><dd><tt>Return True if event is in any of the interaction records' time range.<br> 146 <br> 147 Args:<br> 148 event: an instance of telemetry.timeline.event.TimelineEvent.<br> 149 interaction_records: a list of interaction records, whereas each record is<br> 150 an instance of<br> 151 telemetry.web_perf.timeline_interaction_record.TimelineInteractionRecord.<br> 152 <br> 153 Returns:<br> 154 True if |event|'s start & end time is in any of the |interaction_records|'s<br> 155 time range.</tt></dd></dl> 156 </td></tr></table> 157 </body></html>