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 73dca043facc3432dbd6b0651d91e199fb5e7423..32f8694fbab8fd8a12405e60b59c6c37fa80ba89 100644 |
--- a/tools/telemetry/telemetry/web_perf/metrics/smoothness.py |
+++ b/tools/telemetry/telemetry/web_perf/metrics/smoothness.py |
@@ -30,7 +30,7 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric): |
frame_times: A list of raw frame times |
mean_frame_time: The arithmetic mean of frame times |
- mostly_smooth: Whether we hit 60 fps for 95% of all frames |
+ percentage_smooth: Percentage of frames that were hitting 60 FPS. |
jank: The absolute discrepancy of frame timestamps |
mean_pixels_approximated: The mean percentage of pixels approximated |
queueing_durations: The queueing delay between compositor & main threads |
@@ -146,19 +146,20 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric): |
def _ComputeFrameTimeMetric(self, page, stats): |
"""Returns Values for the frame time metrics. |
- This includes the raw and mean frame times, as well as the mostly_smooth |
- metric which tracks whether we hit 60 fps for 95% of the frames. |
+ This includes the raw and mean frame times, as well as the percentage of |
+ frames that were hitting 60 fps. |
qyearsley
2014/10/10 04:02:21
Since smooth_threshold below is 19.0, is this actu
ernstm
2014/10/10 20:13:08
I lowered the threshold to 17.0ms. We will be able
|
""" |
frame_times = None |
mean_frame_time = None |
- mostly_smooth = None |
+ percentage_smooth = None |
none_value_reason = None |
if self._HasEnoughFrames(stats.frame_timestamps): |
frame_times = FlattenList(stats.frame_times) |
mean_frame_time = round(statistics.ArithmeticMean(frame_times), 3) |
# We use 19ms as a somewhat looser threshold, instead of 1000.0/60.0. |
- percentile_95 = statistics.Percentile(frame_times, 95.0) |
- mostly_smooth = 1.0 if percentile_95 < 19.0 else 0.0 |
+ smooth_threshold = 19.0 |
+ smooth_count = sum(1 for t in frame_times if t < smooth_threshold) |
+ percentage_smooth = float(smooth_count) / len(frame_times) * 100.0 |
else: |
none_value_reason = NOT_ENOUGH_FRAMES_MESSAGE |
return ( |
@@ -172,9 +173,8 @@ class SmoothnessMetric(timeline_based_metric.TimelineBasedMetric): |
description='Arithmetic mean of frame times.', |
none_value_reason=none_value_reason), |
scalar.ScalarValue( |
- page, 'mostly_smooth', 'score', mostly_smooth, |
- description='Were 95 percent of the frames hitting 60 fps?' |
- 'boolean value (1/0).', |
+ page, 'percentage_smooth', 'score', percentage_smooth, |
+ description='Percentage of frames that were hitting 60 fps.', |
none_value_reason=none_value_reason) |
) |