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

Unified Diff: tools/perf/metrics/media.py

Issue 738973005: Measure video stats for WebRTC calls to ensure video works. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now excluding metrics that aren't hooked up for WebRTC video tags. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/measurements/webrtc.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/media.py
diff --git a/tools/perf/metrics/media.py b/tools/perf/metrics/media.py
index f26e715433773b11ca8353a033cd3b810478c598..6680d8487d4738b5a83ee655096aa461d1218804 100644
--- a/tools/perf/metrics/media.py
+++ b/tools/perf/metrics/media.py
@@ -34,15 +34,19 @@ class MediaMetric(Metric):
def Stop(self, page, tab):
self._results = tab.EvaluateJavaScript('window.__getAllMetrics()')
- def AddResults(self, tab, results):
+ # Optional |exclude_metrics| args are not in base class Metric.
+ # pylint: disable=W0221
+ def AddResults(self, tab, results, exclude_metrics=None):
"""Reports all recorded metrics as Telemetry perf results."""
+ exclude_metrics = exclude_metrics or []
trace_names = []
for media_metric in self._results:
- trace_names.append(self._AddResultsForMediaElement(media_metric, results))
+ trace_names.append(self._AddResultsForMediaElement(media_metric, results,
+ exclude_metrics))
return '_'.join(trace_names) or tab.url
- def _AddResultsForMediaElement(self, media_metric, results):
+ def _AddResultsForMediaElement(self, media_metric, results, exclude_metrics):
"""Reports metrics for one media element.
Media metrics contain an ID identifying the media element and values:
@@ -56,6 +60,9 @@ class MediaMetric(Metric):
}
"""
def AddOneResult(metric, unit):
+ if metric in exclude_metrics:
+ return
+
metrics = media_metric['metrics']
for m in metrics:
if m.startswith(metric):
« no previous file with comments | « tools/perf/measurements/webrtc.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698