Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 'decoded_bytes': 13233, | 51 'decoded_bytes': 13233, |
| 52 ... | 52 ... |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 """ | 55 """ |
| 56 def AddOneResult(metric, unit): | 56 def AddOneResult(metric, unit): |
| 57 metrics = media_metric['metrics'] | 57 metrics = media_metric['metrics'] |
| 58 for m in metrics: | 58 for m in metrics: |
| 59 if m.startswith(metric): | 59 if m.startswith(metric): |
| 60 special_label = m[len(metric):] | 60 special_label = m[len(metric):] |
| 61 results.Add(trace + special_label, unit, metrics[m], | 61 results.Add(trace + special_label, unit, float(metrics[m]), |
|
shadi
2013/11/27 19:58:11
Not needed once https://codereview.chromium.org/83
| |
| 62 chart_name=metric, data_type='default') | 62 chart_name=metric, data_type='default') |
| 63 | 63 |
| 64 trace = media_metric['id'] | 64 trace = media_metric['id'] |
| 65 if not trace: | 65 if not trace: |
| 66 logging.error('Metrics ID is missing in results.') | 66 logging.error('Metrics ID is missing in results.') |
| 67 return | 67 return |
| 68 | 68 |
| 69 if not self._skip_basic_metrics: | 69 if not self._skip_basic_metrics: |
| 70 AddOneResult('buffering_time', 'ms') | 70 AddOneResult('buffering_time', 'ms') |
| 71 AddOneResult('decoded_audio_bytes', 'bytes') | 71 AddOneResult('decoded_audio_bytes', 'bytes') |
| 72 AddOneResult('decoded_video_bytes', 'bytes') | 72 AddOneResult('decoded_video_bytes', 'bytes') |
| 73 AddOneResult('decoded_frame_count', 'frames') | 73 AddOneResult('decoded_frame_count', 'frames') |
| 74 AddOneResult('dropped_frame_count', 'frames') | 74 AddOneResult('dropped_frame_count', 'frames') |
| 75 AddOneResult('time_to_play', 'ms') | 75 AddOneResult('time_to_play', 'ms') |
| 76 | 76 |
| 77 AddOneResult('avg_loop_time', 'ms') | 77 AddOneResult('avg_loop_time', 'ms') |
| 78 AddOneResult('seek', 'ms') | 78 AddOneResult('seek', 'ms') |
| 79 AddOneResult('mse', 'ms') | 79 AddOneResult('mse', 'ms') |
| 80 return trace | 80 return trace |
| OLD | NEW |