Chromium Code Reviews| Index: tools/perf/metrics/smoothness.py |
| diff --git a/tools/perf/metrics/smoothness.py b/tools/perf/metrics/smoothness.py |
| index b8344442eff0d6868855186b4f7b25e1fc8b3efa..c632fea7a7ace9e0df6cedec55f48345ced059ae 100644 |
| --- a/tools/perf/metrics/smoothness.py |
| +++ b/tools/perf/metrics/smoothness.py |
| @@ -9,7 +9,7 @@ from telemetry.core.timeline.model import MarkerMismatchError |
| from telemetry.core.timeline.model import MarkerOverlapError |
| from telemetry.page import page_measurement |
| -TIMELINE_MARKER = 'SmoothnessMetric' |
| +TIMELINE_MARKER = 'Smoothness' |
| class NotEnoughFramesError(page_measurement.MeasurementFailure): |
| @@ -51,7 +51,7 @@ class SmoothnessMetric(Metric): |
| def Stop(self, page, tab): |
| tab.ExecuteJavaScript('console.timeEnd("' + TIMELINE_MARKER + '")') |
| timeline_model = tab.browser.StopTracing().AsTimelineModel() |
| - render_process_marker = timeline_model.FindTimelineMarkers(TIMELINE_MARKER) |
| + smoothness_marker = timeline_model.FindTimelineMarkers(TIMELINE_MARKER) |
| timeline_marker_labels = GetTimelineMarkerLabelsFromAction( |
|
nduca
2013/10/31 07:32:02
Labels is a bit funky. TimelineEvents have names,
ernstm
2013/11/05 00:25:05
Done.
|
| self._compound_action) |
| try: |
| @@ -60,16 +60,22 @@ class SmoothnessMetric(Metric): |
| except MarkerMismatchError: |
| # TODO(ernstm): re-raise exception as MeasurementFailure when the |
| # reference build was updated. |
| - timeline_markers = render_process_marker |
| + timeline_markers = smoothness_marker |
| except MarkerOverlapError as e: |
| raise page_measurement.MeasurementFailure(str(e)) |
| + renderer_process = timeline_model.GetRendererProcessFromTab(tab) |
| self._stats = rendering_stats.RenderingStats( |
| - render_process_marker, timeline_markers) |
| + renderer_process, timeline_markers) |
| if not self._stats.frame_times: |
| raise NotEnoughFramesError() |
| + def SetStats(self, stats): |
|
nduca
2013/10/31 07:32:02
This isn't quite the right direction to be pursuin
ernstm
2013/11/05 00:25:05
I agree that smoothness_unittest.py needs a major
|
| + """ Pass in a RenderingStats object directly. For unittests that don't call |
| + Start/Stop. |
| + """ |
| + self._stats = stats |
| def AddResults(self, tab, results): |
| # List of raw frame times. |