| 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 | |
| 8 from telemetry.value import list_of_scalar_values | 7 from telemetry.value import list_of_scalar_values |
| 9 from telemetry.value import scalar | 8 from telemetry.value import scalar |
| 10 | 9 |
| 10 from metrics import Metric |
| 11 |
| 11 | 12 |
| 12 class MediaMetric(Metric): | 13 class MediaMetric(Metric): |
| 13 """MediaMetric class injects and calls JS responsible for recording metrics. | 14 """MediaMetric class injects and calls JS responsible for recording metrics. |
| 14 | 15 |
| 15 Default media metrics are collected for every media element in the page, | 16 Default media metrics are collected for every media element in the page, |
| 16 such as decoded_frame_count, dropped_frame_count, decoded_video_bytes, and | 17 such as decoded_frame_count, dropped_frame_count, decoded_video_bytes, and |
| 17 decoded_audio_bytes. | 18 decoded_audio_bytes. |
| 18 """ | 19 """ |
| 19 | 20 |
| 20 def __init__(self, tab): | 21 def __init__(self, tab): |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 AddOneResult('buffering_time', 'ms') | 88 AddOneResult('buffering_time', 'ms') |
| 88 AddOneResult('decoded_audio_bytes', 'bytes') | 89 AddOneResult('decoded_audio_bytes', 'bytes') |
| 89 AddOneResult('decoded_video_bytes', 'bytes') | 90 AddOneResult('decoded_video_bytes', 'bytes') |
| 90 AddOneResult('decoded_frame_count', 'frames') | 91 AddOneResult('decoded_frame_count', 'frames') |
| 91 AddOneResult('dropped_frame_count', 'frames') | 92 AddOneResult('dropped_frame_count', 'frames') |
| 92 AddOneResult('time_to_play', 'ms') | 93 AddOneResult('time_to_play', 'ms') |
| 93 | 94 |
| 94 AddOneResult('avg_loop_time', 'ms') | 95 AddOneResult('avg_loop_time', 'ms') |
| 95 AddOneResult('seek', 'ms') | 96 AddOneResult('seek', 'ms') |
| 96 return trace | 97 return trace |
| OLD | NEW |