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

Unified Diff: tools/perf/metrics/media.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/perf/metrics/media.py
diff --git a/tools/perf/metrics/media.py b/tools/perf/metrics/media.py
index 6680d8487d4738b5a83ee655096aa461d1218804..701f509dbeb5aa3df9b9850e1da4903afcad0245 100644
--- a/tools/perf/metrics/media.py
+++ b/tools/perf/metrics/media.py
@@ -5,6 +5,7 @@ import logging
import os
from metrics import Metric
+from telemetry.value import improvement_direction
from telemetry.value import list_of_scalar_values
from telemetry.value import scalar
@@ -59,7 +60,7 @@ class MediaMetric(Metric):
}
}
"""
- def AddOneResult(metric, unit):
+ def AddOneResult(metric, unit, direction):
if metric in exclude_metrics:
return
@@ -72,11 +73,11 @@ class MediaMetric(Metric):
results.AddValue(list_of_scalar_values.ListOfScalarValues(
results.current_page, trace_name, unit,
values=[float(v) for v in metrics[m]],
- important=True))
+ important=True, improvement_direction=direction))
else:
results.AddValue(scalar.ScalarValue(
results.current_page, trace_name, unit, value=float(metrics[m]),
- important=True))
+ important=True, improvement_direction=direction))
trace = media_metric['id']
if not trace:
@@ -84,13 +85,13 @@ class MediaMetric(Metric):
return
if not self._skip_basic_metrics:
- AddOneResult('buffering_time', 'ms')
- AddOneResult('decoded_audio_bytes', 'bytes')
- AddOneResult('decoded_video_bytes', 'bytes')
- AddOneResult('decoded_frame_count', 'frames')
- AddOneResult('dropped_frame_count', 'frames')
- AddOneResult('time_to_play', 'ms')
+ AddOneResult('buffering_time', 'ms', improvement_direction.DOWN)
+ AddOneResult('decoded_audio_bytes', 'bytes', improvement_direction.DOWN)
+ AddOneResult('decoded_video_bytes', 'bytes', improvement_direction.DOWN)
+ AddOneResult('decoded_frame_count', 'frames', improvement_direction.DOWN)
+ AddOneResult('dropped_frame_count', 'frames', improvement_direction.DOWN)
+ AddOneResult('time_to_play', 'ms', improvement_direction.DOWN)
- AddOneResult('avg_loop_time', 'ms')
- AddOneResult('seek', 'ms')
+ AddOneResult('avg_loop_time', 'ms', improvement_direction.DOWN)
+ AddOneResult('seek', 'ms', improvement_direction.DOWN)
return trace

Powered by Google App Engine
This is Rietveld 408576698