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 class MediaMetric(Metric): | 9 class MediaMetric(Metric): |
10 """MediaMetric class injects and calls JS responsible for recording metrics. | 10 """MediaMetric class injects and calls JS responsible for recording metrics. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 for m in metrics: | 51 for m in metrics: |
52 if m.startswith(metric): | 52 if m.startswith(metric): |
53 special_label = m[len(metric):] | 53 special_label = m[len(metric):] |
54 results.Add(trace + special_label, unit, str(metrics[m]), | 54 results.Add(trace + special_label, unit, str(metrics[m]), |
55 chart_name=metric, data_type='default') | 55 chart_name=metric, data_type='default') |
56 | 56 |
57 trace = media_metric['id'] | 57 trace = media_metric['id'] |
58 if not trace: | 58 if not trace: |
59 logging.error('Metrics ID is missing in results.') | 59 logging.error('Metrics ID is missing in results.') |
60 return | 60 return |
| 61 AddOneResult('avg_loop_time', 'sec') |
61 AddOneResult('decoded_audio_bytes', 'bytes') | 62 AddOneResult('decoded_audio_bytes', 'bytes') |
62 AddOneResult('decoded_video_bytes', 'bytes') | 63 AddOneResult('decoded_video_bytes', 'bytes') |
63 AddOneResult('decoded_frame_count', 'frames') | 64 AddOneResult('decoded_frame_count', 'frames') |
64 AddOneResult('dropped_frame_count', 'frames') | 65 AddOneResult('dropped_frame_count', 'frames') |
65 AddOneResult('playback_time', 'sec') | 66 AddOneResult('playback_time', 'sec') |
66 AddOneResult('seek', 'sec') | 67 AddOneResult('seek', 'sec') |
67 AddOneResult('time_to_play', 'sec') | 68 AddOneResult('time_to_play', 'sec') |
68 | 69 |
OLD | NEW |