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

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

Issue 1458083003: [Telemetry + tools/perf] Modify the pylint disable message to use symbolic name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « tools/perf/metrics/cpu_unittest.py ('k') | tools/perf/metrics/memory.py » ('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 telemetry.value import list_of_scalar_values 7 from telemetry.value import list_of_scalar_values
8 from telemetry.value import scalar 8 from telemetry.value import scalar
9 9
10 from metrics import Metric 10 from metrics import Metric
(...skipping 18 matching lines...) Expand all
29 def Start(self, page, tab): 29 def Start(self, page, tab):
30 """Create the media metrics for all media elements in the document.""" 30 """Create the media metrics for all media elements in the document."""
31 if hasattr(page, 'skip_basic_metrics'): 31 if hasattr(page, 'skip_basic_metrics'):
32 self._skip_basic_metrics = page.skip_basic_metrics 32 self._skip_basic_metrics = page.skip_basic_metrics
33 tab.ExecuteJavaScript('window.__createMediaMetricsForDocument()') 33 tab.ExecuteJavaScript('window.__createMediaMetricsForDocument()')
34 34
35 def Stop(self, page, tab): 35 def Stop(self, page, tab):
36 self._results = tab.EvaluateJavaScript('window.__getAllMetrics()') 36 self._results = tab.EvaluateJavaScript('window.__getAllMetrics()')
37 37
38 # Optional |exclude_metrics| args are not in base class Metric. 38 # Optional |exclude_metrics| args are not in base class Metric.
39 # pylint: disable=W0221 39 # pylint: disable=arguments-differ
40 def AddResults(self, tab, results, exclude_metrics=None): 40 def AddResults(self, tab, results, exclude_metrics=None):
41 """Reports all recorded metrics as Telemetry perf results.""" 41 """Reports all recorded metrics as Telemetry perf results."""
42 exclude_metrics = exclude_metrics or [] 42 exclude_metrics = exclude_metrics or []
43 trace_names = [] 43 trace_names = []
44 for media_metric in self._results: 44 for media_metric in self._results:
45 trace_names.append(self._AddResultsForMediaElement(media_metric, results, 45 trace_names.append(self._AddResultsForMediaElement(media_metric, results,
46 exclude_metrics)) 46 exclude_metrics))
47 47
48 return '_'.join(trace_names) or tab.url 48 return '_'.join(trace_names) or tab.url
49 49
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 AddOneResult('buffering_time', 'ms') 88 AddOneResult('buffering_time', 'ms')
89 AddOneResult('decoded_audio_bytes', 'bytes') 89 AddOneResult('decoded_audio_bytes', 'bytes')
90 AddOneResult('decoded_video_bytes', 'bytes') 90 AddOneResult('decoded_video_bytes', 'bytes')
91 AddOneResult('decoded_frame_count', 'frames') 91 AddOneResult('decoded_frame_count', 'frames')
92 AddOneResult('dropped_frame_count', 'frames') 92 AddOneResult('dropped_frame_count', 'frames')
93 AddOneResult('time_to_play', 'ms') 93 AddOneResult('time_to_play', 'ms')
94 94
95 AddOneResult('avg_loop_time', 'ms') 95 AddOneResult('avg_loop_time', 'ms')
96 AddOneResult('seek', 'ms') 96 AddOneResult('seek', 'ms')
97 return trace 97 return trace
OLDNEW
« no previous file with comments | « tools/perf/metrics/cpu_unittest.py ('k') | tools/perf/metrics/memory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698