telemetry.web_perf.metrics.timeline_based_metric | index telemetry/web_perf/metrics/timeline_based_metric.py

`# Copyright 2014 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.`

Classes
`` |  |

__builtin__.object
  TimelineBasedMetric
exceptions.Exception(exceptions.BaseException)
  TimelineBasedMetricException

class TimelineBasedMetric(__builtin__.object)
`` |  | Methods defined here:

AddResults(self, model, renderer_thread, interaction_records, results)
  `Computes and adds metrics for the interaction_records' time ranges.
  The override of this method should compute results on the data **only**
  within the interaction_records' start and end time ranges.
  Args:
  model: An instance of telemetry.timeline.model.TimelineModel.
  interaction_records: A list of instances of TimelineInteractionRecord. If
  the override of this method doesn't support overlapped ranges, use
  VerifyNonOverlappedRecords to check that no records are overlapped.
  results: An instance of page.PageTestResults.`

AddWholeTraceResults(self, model, results)
  `Computes and adds metrics corresponding to the entire trace.
  Override this method to compute results that correspond to the whole trace.
  Args:
  model: An instance of telemetry.timeline.model.TimelineModel.
  results: An instance of page.PageTestResults.`

VerifyNonOverlappedRecords(self, interaction_records)
  `This raises exceptions if interaction_records contain overlapped ranges.`

__init__(self)
  `Computes metrics from a telemetry.timeline Model and a range`

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class TimelineBasedMetricException(exceptions.Exception)
`` | `Exception that can be thrown from metrics that implements TimelineBasedMetric to indicate a problem arised when computing the metric.`

Method resolution order:
  TimelineBasedMetricException
  exceptions.Exception
  exceptions.BaseException
  __builtin__.object

Data descriptors defined here:

__weakref__
  `list of weak references to the object (if defined)`

Methods inherited from exceptions.Exception:

__init__(...)
  `x.__init__(...) initializes x; see help(type(x)) for signature`

Data and other attributes inherited from exceptions.Exception:

__new__ = <built-in method __new__ of type object>
  `T.__new__(S, ...) -> a new object with type S, a subtype of T`

Methods inherited from exceptions.BaseException:

__delattr__(...)
  `x.__delattr__('name') <==> del x.name`

__getattribute__(...)
  `x.__getattribute__('name') <==> x.name`

__getitem__(...)
  `x.__getitem__(y) <==> x[y]`

__getslice__(...)
  `x.__getslice__(i, j) <==> x[i:j]
  Use of negative indices is not supported.`

__reduce__(...)

__repr__(...)
  `x.__repr__() <==> repr(x)`

__setattr__(...)
  `x.__setattr__('name', value) <==> x.name = value`

__setstate__(...)

__str__(...)
  `x.__str__() <==> str(x)`

__unicode__(...)

Data descriptors inherited from exceptions.BaseException:

__dict__

args

message

Functions
`` |  |

IsEventInInteractions(event, interaction_records)
  `Return True if event is in any of the interaction records' time range.
  Args:
  event: an instance of telemetry.timeline.event.TimelineEvent.
  interaction_records: a list of interaction records, whereas each record is
  an instance of
  telemetry.web_perf.timeline_interaction_record.TimelineInteractionRecord.
  Returns:
  True if |event|'s start & end time is in any of the |interaction_records|'s
  time range.`