Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Unified Diff: tools/telemetry/telemetry/web_perf/metrics/smoothness.py

Issue 535783002: Update smoothness.py to restore summarized results for some metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix AssertionError Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/web_perf/metrics/smoothness_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/web_perf/metrics/smoothness.py
diff --git a/tools/telemetry/telemetry/web_perf/metrics/smoothness.py b/tools/telemetry/telemetry/web_perf/metrics/smoothness.py
index d795194d4da5671612a846d4e875eddbe5923457..7f10c71839c25e35dec924c7b2f903ace1130133 100644
--- a/tools/telemetry/telemetry/web_perf/metrics/smoothness.py
+++ b/tools/telemetry/telemetry/web_perf/metrics/smoothness.py
@@ -55,15 +55,15 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
def _PopulateResultsFromStats(self, results, stats):
page = results.current_page
values = [
- self._ComputeFirstGestureScrollUpdateLatency(page, stats),
self._ComputeQueueingDuration(page, stats),
self._ComputeFrameTimeDiscrepancy(page, stats),
self._ComputeMeanPixelsApproximated(page, stats)
]
values += self._ComputeLatencyMetric(page, stats, 'input_event_latency',
- stats.input_event_latency)
+ stats.input_event_latency)
values += self._ComputeLatencyMetric(page, stats, 'scroll_update_latency',
- stats.scroll_update_latency)
+ stats.scroll_update_latency)
+ values += self._ComputeFirstGestureScrollUpdateLatency(page, stats)
values += self._ComputeFrameTimeMetric(page, stats)
for v in values:
results.AddValue(v)
@@ -79,12 +79,11 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
none_value_reason = None
if self._HasEnoughFrames(stats.frame_timestamps):
latency_list = FlattenList(list_of_latency_lists)
- if len(latency_list) > 0:
- mean_latency = round(statistics.ArithmeticMean(latency_list), 3)
- latency_discrepancy = (
- round(statistics.DurationsDiscrepancy(latency_list), 4))
- else:
- none_value_reason = 'No latency values recorded.'
+ if len(latency_list) == 0:
+ return ()
+ mean_latency = round(statistics.ArithmeticMean(latency_list), 3)
+ latency_discrepancy = (
+ round(statistics.DurationsDiscrepancy(latency_list), 4))
else:
none_value_reason = NOT_ENOUGH_FRAMES_MESSAGE
return (
@@ -104,20 +103,21 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
none_value_reason = None
if self._HasEnoughFrames(stats.frame_timestamps):
latency_list = FlattenList(stats.gesture_scroll_update_latency)
- if len(latency_list) > 0:
- first_gesture_scroll_update_latency = round(latency_list[0], 4)
- else:
- none_value_reason = 'No gesture scroll update latency values recorded.'
+ if len(latency_list) == 0:
+ return ()
+ first_gesture_scroll_update_latency = round(latency_list[0], 4)
else:
none_value_reason = NOT_ENOUGH_FRAMES_MESSAGE
- return scalar.ScalarValue(
+ return (
+ scalar.ScalarValue(
page, 'first_gesture_scroll_update_latency', 'ms',
first_gesture_scroll_update_latency,
description='First gesture scroll update latency measures the time it '
'takes to process the very first gesture scroll update '
'input event. The first scroll gesture can often get '
'delayed by work related to page loading.',
- none_value_reason=none_value_reason)
+ none_value_reason=none_value_reason),
+ )
def _ComputeQueueingDuration(self, page, stats):
"""Returns a Value for the frame queueing durations."""
« no previous file with comments | « no previous file | tools/telemetry/telemetry/web_perf/metrics/smoothness_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698