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

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

Issue 809393002: Added support for improvement_direction to relevant values, which is propogated to chartjson. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix linter issues Created 5 years, 11 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
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 f63fea8bed3b45ec5c6ceaab2248f226f85c7e76..00eb74fe3043e4df4af057e98334b3c4489d3fa3 100644
--- a/tools/telemetry/telemetry/web_perf/metrics/smoothness.py
+++ b/tools/telemetry/telemetry/web_perf/metrics/smoothness.py
@@ -5,6 +5,7 @@
import logging
from telemetry.perf_tests_helper import FlattenList
from telemetry.util import statistics
+from telemetry.value import improvement_direction
from telemetry.value import list_of_scalar_values
from telemetry.value import scalar
from telemetry.web_perf.metrics import rendering_stats
@@ -124,22 +125,26 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
page, 'avg_surface_fps', 'fps', avg_surface_fps,
description='Average frames per second as measured by the '
'platform\'s SurfaceFlinger.',
- none_value_reason=none_value_reason),
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.UP),
scalar.ScalarValue(
page, 'jank_count', 'janks', jank_count,
description='Number of changes in frame rate as measured by the '
'platform\'s SurfaceFlinger.',
- none_value_reason=none_value_reason),
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN),
scalar.ScalarValue(
page, 'max_frame_delay', 'vsyncs', max_frame_delay,
description='Largest frame time as measured by the platform\'s '
'SurfaceFlinger.',
- none_value_reason=none_value_reason),
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN),
list_of_scalar_values.ListOfScalarValues(
page, 'frame_lengths', 'vsyncs', frame_lengths,
description='Frame time in vsyncs as measured by the platform\'s '
'SurfaceFlinger.',
- none_value_reason=none_value_reason)
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN)
)
def _ComputeLatencyMetric(self, page, stats, name, list_of_latency_lists):
@@ -160,11 +165,13 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
scalar.ScalarValue(
page, 'mean_%s' % name, 'ms', mean_latency,
description='Arithmetic mean of the raw %s values' % name,
- none_value_reason=none_value_reason),
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN),
scalar.ScalarValue(
page, '%s_discrepancy' % name, 'ms', latency_discrepancy,
description='Discrepancy of the raw %s values' % name,
- none_value_reason=none_value_reason)
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN)
)
def _ComputeFirstGestureScrollUpdateLatency(self, page, stats):
@@ -186,7 +193,8 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
'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,
+ improvement_direction=improvement_direction.DOWN),
)
def _ComputeQueueingDuration(self, page, stats):
@@ -210,7 +218,8 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
'ScheduledActionSendBeginMainFrame event in the compositor '
'thread and the corresponding BeginMainFrame event in the '
'main thread.',
- none_value_reason=none_value_reason)
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN)
def _ComputeFrameTimeMetric(self, page, stats):
"""Returns Values for the frame time metrics.
@@ -236,15 +245,18 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
page, 'frame_times', 'ms', frame_times,
description='List of raw frame times, helpful to understand the '
'other metrics.',
- none_value_reason=none_value_reason),
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN),
scalar.ScalarValue(
page, 'mean_frame_time', 'ms', mean_frame_time,
description='Arithmetic mean of frame times.',
- none_value_reason=none_value_reason),
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN),
scalar.ScalarValue(
page, 'percentage_smooth', 'score', percentage_smooth,
description='Percentage of frames that were hitting 60 fps.',
- none_value_reason=none_value_reason)
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN)
)
def _ComputeFrameTimeDiscrepancy(self, page, stats):
@@ -267,7 +279,8 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
'is important because even if the mean and 95th '
'percentile are good, one long pause in the middle of an '
'interaction is still bad.',
- none_value_reason=none_value_reason)
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN)
def _ComputeMeanPixelsApproximated(self, page, stats):
"""Add the mean percentage of pixels approximated.
@@ -285,4 +298,5 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric):
page, 'mean_pixels_approximated', 'percent', mean_pixels_approximated,
description='Percentage of pixels that were approximated '
'(checkerboarding, low-resolution tiles, etc.).',
- none_value_reason=none_value_reason)
+ none_value_reason=none_value_reason,
+ improvement_direction=improvement_direction.DOWN)

Powered by Google App Engine
This is Rietveld 408576698