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

Side by Side Diff: tools/perf/metrics/media.py

Issue 24159003: No need to cast to str in media metric results. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import logging 4 import logging
5 import os 5 import os
6 6
7 from metrics import Metric 7 from metrics import Metric
8 8
9 9
10 class MediaMetric(Metric): 10 class MediaMetric(Metric):
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 'decoded_bytes': 13233, 49 'decoded_bytes': 13233,
50 ... 50 ...
51 } 51 }
52 } 52 }
53 """ 53 """
54 def AddOneResult(metric, unit): 54 def AddOneResult(metric, unit):
55 metrics = media_metric['metrics'] 55 metrics = media_metric['metrics']
56 for m in metrics: 56 for m in metrics:
57 if m.startswith(metric): 57 if m.startswith(metric):
58 special_label = m[len(metric):] 58 special_label = m[len(metric):]
59 results.Add(trace + special_label, unit, str(metrics[m]), 59 results.Add(trace + special_label, unit, metrics[m],
60 chart_name=metric, data_type='default') 60 chart_name=metric, data_type='default')
61 61
62 trace = media_metric['id'] 62 trace = media_metric['id']
63 if not trace: 63 if not trace:
64 logging.error('Metrics ID is missing in results.') 64 logging.error('Metrics ID is missing in results.')
65 return 65 return
66 66
67 if not self._skip_basic_metrics: 67 if not self._skip_basic_metrics:
68 AddOneResult('buffering_time', 'ms') 68 AddOneResult('buffering_time', 'ms')
69 AddOneResult('decoded_audio_bytes', 'bytes') 69 AddOneResult('decoded_audio_bytes', 'bytes')
70 AddOneResult('decoded_video_bytes', 'bytes') 70 AddOneResult('decoded_video_bytes', 'bytes')
71 AddOneResult('decoded_frame_count', 'frames') 71 AddOneResult('decoded_frame_count', 'frames')
72 AddOneResult('dropped_frame_count', 'frames') 72 AddOneResult('dropped_frame_count', 'frames')
73 AddOneResult('time_to_play', 'ms') 73 AddOneResult('time_to_play', 'ms')
74 74
75 AddOneResult('avg_loop_time', 'ms') 75 AddOneResult('avg_loop_time', 'ms')
76 AddOneResult('seek', 'ms') 76 AddOneResult('seek', 'ms')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698