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

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

Issue 70333004: Telemetry: make media perf tests log errors rather than timing out (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « tools/perf/metrics/media.js ('k') | tools/perf/page_sets/tough_video_cases/video.html » ('j') | 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 16 matching lines...) Expand all
27 """Create the media metrics for all media elements in the document.""" 27 """Create the media metrics for all media elements in the document."""
28 if hasattr(page, 'skip_basic_metrics'): 28 if hasattr(page, 'skip_basic_metrics'):
29 self._skip_basic_metrics = page.skip_basic_metrics 29 self._skip_basic_metrics = page.skip_basic_metrics
30 tab.ExecuteJavaScript('window.__createMediaMetricsForDocument()') 30 tab.ExecuteJavaScript('window.__createMediaMetricsForDocument()')
31 31
32 def Stop(self, page, tab): 32 def Stop(self, page, tab):
33 self._results = tab.EvaluateJavaScript('window.__getAllMetrics()') 33 self._results = tab.EvaluateJavaScript('window.__getAllMetrics()')
34 34
35 def AddResults(self, tab, results): 35 def AddResults(self, tab, results):
36 """Reports all recorded metrics as Telemetry perf results.""" 36 """Reports all recorded metrics as Telemetry perf results."""
37 assert self._results
38 trace_names = [] 37 trace_names = []
39 for media_metric in self._results: 38 for media_metric in self._results:
40 trace_names.append(self._AddResultsForMediaElement(media_metric, results)) 39 trace_names.append(self._AddResultsForMediaElement(media_metric, results))
41 40
42 return '_'.join(trace_names) or tab.url 41 return '_'.join(trace_names) or tab.url
43 42
44 def _AddResultsForMediaElement(self, media_metric, results): 43 def _AddResultsForMediaElement(self, media_metric, results):
45 """Reports metrics for one media element. 44 """Reports metrics for one media element.
46 45
47 Media metrics contain an ID identifying the media element and values: 46 Media metrics contain an ID identifying the media element and values:
(...skipping 23 matching lines...) Expand all
71 AddOneResult('buffering_time', 'ms') 70 AddOneResult('buffering_time', 'ms')
72 AddOneResult('decoded_audio_bytes', 'bytes') 71 AddOneResult('decoded_audio_bytes', 'bytes')
73 AddOneResult('decoded_video_bytes', 'bytes') 72 AddOneResult('decoded_video_bytes', 'bytes')
74 AddOneResult('decoded_frame_count', 'frames') 73 AddOneResult('decoded_frame_count', 'frames')
75 AddOneResult('dropped_frame_count', 'frames') 74 AddOneResult('dropped_frame_count', 'frames')
76 AddOneResult('time_to_play', 'ms') 75 AddOneResult('time_to_play', 'ms')
77 76
78 AddOneResult('avg_loop_time', 'ms') 77 AddOneResult('avg_loop_time', 'ms')
79 AddOneResult('seek', 'ms') 78 AddOneResult('seek', 'ms')
80 return trace 79 return trace
OLDNEW
« no previous file with comments | « tools/perf/metrics/media.js ('k') | tools/perf/page_sets/tough_video_cases/video.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698