diff options
author | ernstm@chromium.org <ernstm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 01:02:36 +0000 |
---|---|---|
committer | ernstm@chromium.org <ernstm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 01:02:36 +0000 |
commit | 8a3fda7eae54500b6adc0b70651a292179a0921f (patch) | |
tree | d4ca6e92ea7e90e06405f2f7ad1b7c329a973d78 /tools/perf | |
parent | 83c767caa8c9d05223c0f9cb7daee3fcb8df93ea (diff) | |
download | chromium_src-8a3fda7eae54500b6adc0b70651a292179a0921f.zip chromium_src-8a3fda7eae54500b6adc0b70651a292179a0921f.tar.gz chromium_src-8a3fda7eae54500b6adc0b70651a292179a0921f.tar.bz2 |
telemetry: Fix smoothness metric and repaint measurement
Completing revert of r256661 (https://codereview.chromium.org/170183004).
https://codereview.chromium.org/198063007/ left some issues in repaint
measurement and smoothness metric, that are fixed by this patch.
TBR=tonyg@chromium.org
BUG=352215
NOTRY=True
Review URL: https://codereview.chromium.org/199753002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256968 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/measurements/repaint.py | 35 | ||||
-rw-r--r-- | tools/perf/metrics/smoothness.py | 6 |
2 files changed, 8 insertions, 33 deletions
diff --git a/tools/perf/measurements/repaint.py b/tools/perf/measurements/repaint.py index e7201e1..5d222297 100644 --- a/tools/perf/measurements/repaint.py +++ b/tools/perf/measurements/repaint.py @@ -3,55 +3,30 @@ # found in the LICENSE file. from metrics import smoothness -from metrics import timeline_interaction_record as tir_module -from telemetry.core.timeline.model import TimelineModel from telemetry.page import page_measurement -import telemetry.core.timeline.bounds as timeline_bounds - class Repaint(page_measurement.PageMeasurement): def __init__(self): super(Repaint, self).__init__('repaint', False) self._smoothness_metric = None - self._timeline_model = None - self._actions = [] def CanRunForPage(self, page): return hasattr(page, 'repaint') def WillRunActions(self, page, tab): tab.WaitForDocumentReadyStateToBeComplete() + self._smoothness_metric = smoothness.SmoothnessMetric() + self._smoothness_metric.Start(page, tab) # Rasterize only what's visible. tab.ExecuteJavaScript( 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') - self._smoothness_metric = smoothness.SmoothnessMetric() - # Start tracing for smoothness metric. - custom_categories = 'webkit.console,benchmark' - tab.browser.StartTracing(custom_categories, 60) def DidRunAction(self, page, tab, action): - self._actions.append(action) + self._smoothness_metric.AddActionToIncludeInMetric(action) def DidRunActions(self, page, tab): - # Stop tracing for smoothness metric. - tracing_timeline_data = tab.browser.StopTracing() - self._timeline_model = TimelineModel(timeline_data=tracing_timeline_data) + self._smoothness_metric.Stop(page, tab) def MeasurePage(self, page, tab, results): - # Add results of smoothness metric. This computes the smoothness metric for - # the time range between the first action starts and the last action ends. - time_bounds = timeline_bounds.Bounds() - for action in self._actions: - time_bounds.AddBounds( - action.GetActiveRangeOnTimeline(self._timeline_model)) - # Create an interaction_record for this legacy measurement. Since we don't - # wrap the results that is sent to smoothnes metric, the logical_name will - # not be used. - interaction_record = tir_module.TimelineInteractionRecord( - 'smoothness_interaction', time_bounds.min, time_bounds.max) - renderer_thread = self._timeline_model.GetRendererThreadFromTab(tab) - self._smoothness_metric.AddResults(self._timeline_model, - renderer_thread, - interaction_record, - results) + self._smoothness_metric.AddResults(tab, results) diff --git a/tools/perf/metrics/smoothness.py b/tools/perf/metrics/smoothness.py index 6b19c0a..44176c7 100644 --- a/tools/perf/metrics/smoothness.py +++ b/tools/perf/metrics/smoothness.py @@ -76,7 +76,7 @@ class SmoothnessMetric(Metric): def AddResults(self, tab, results): if self._stats.mouse_wheel_scroll_latency: mean_mouse_wheel_scroll_latency = statistics.ArithmeticMean( - stats.mouse_wheel_scroll_latency) + self._stats.mouse_wheel_scroll_latency) mouse_wheel_scroll_latency_discrepancy = statistics.DurationsDiscrepancy( self._stats.mouse_wheel_scroll_latency) results.Add('mean_mouse_wheel_scroll_latency', 'ms', @@ -86,7 +86,7 @@ class SmoothnessMetric(Metric): if self._stats.touch_scroll_latency: mean_touch_scroll_latency = statistics.ArithmeticMean( - stats.touch_scroll_latency) + self._stats.touch_scroll_latency) touch_scroll_latency_discrepancy = statistics.DurationsDiscrepancy( self._stats.touch_scroll_latency) results.Add('mean_touch_scroll_latency', 'ms', @@ -96,7 +96,7 @@ class SmoothnessMetric(Metric): if self._stats.js_touch_scroll_latency: mean_js_touch_scroll_latency = statistics.ArithmeticMean( - stats.js_touch_scroll_latency) + self._stats.js_touch_scroll_latency) js_touch_scroll_latency_discrepancy = statistics.DurationsDiscrepancy( self._stats.js_touch_scroll_latency) results.Add('mean_js_touch_scroll_latency', 'ms', |