Index: tools/perf/perf_tools/media_metrics.py |
diff --git a/tools/perf/perf_tools/media_metrics.py b/tools/perf/perf_tools/media_metrics.py |
index 6f85a9aaf9bbc642ac86cce045c031d3bd1b04ac..7fc137b71c3a593b3d1b39e39b19875573d06a5e 100644 |
--- a/tools/perf/perf_tools/media_metrics.py |
+++ b/tools/perf/perf_tools/media_metrics.py |
@@ -1,4 +1,4 @@ |
-# Copyright 2013 The Chromium Authors. All rights reserved. |
+# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
@@ -46,18 +46,20 @@ class MediaMetrics(object): |
""" |
def AddResult(metric, unit): |
tonyg
2013/07/20 19:57:28
Should this be named AddResults now?
shadi
2013/07/22 19:18:31
Yeah why not :)
|
metrics = media_metric['metrics'] |
- if metric in metrics: |
- results.Add(trace, unit, str(metrics[metric]), chart_name=metric, |
- data_type='default') |
+ for m in metrics: |
+ if m.startswith(metric): |
+ special_label = m[len(metric):] |
+ results.Add(trace + special_label, unit, str(metrics[m]), |
+ chart_name=metric, data_type='default') |
trace = media_metric['id'] |
if not trace: |
logging.error('Metrics ID is missing in results.') |
return |
- |
- AddResult('time_to_play', 'sec') |
- AddResult('playback_time', 'sec') |
AddResult('decoded_audio_bytes', 'bytes') |
AddResult('decoded_video_bytes', 'bytes') |
AddResult('decoded_frame_count', 'frames') |
AddResult('dropped_frame_count', 'frames') |
+ AddResult('playback_time', 'sec') |
+ AddResult('seek', 'sec') |
+ AddResult('time_to_play', 'sec') |