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

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

Issue 23523005: Make recording basic media metrics optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve merge conflicts. Created 7 years, 3 months 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 | « no previous file | tools/perf/metrics/media.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 4
5 from metrics import media 5 from metrics import media
6 from telemetry.page import page_measurement 6 from telemetry.page import page_measurement
7 7
8
8 class Media(page_measurement.PageMeasurement): 9 class Media(page_measurement.PageMeasurement):
9 """The MediaMeasurement class gathers media-related metrics on a page set. 10 """The MediaMeasurement class gathers media-related metrics on a page set.
10 11
11 Media metrics recorded are controlled by metrics/media.js. At the end of the 12 Media metrics recorded are controlled by metrics/media.js. At the end of the
12 test each metric for every media element in the page are reported. 13 test each metric for every media element in the page are reported.
13 """ 14 """
14 def __init__(self): 15 def __init__(self):
15 super(Media, self).__init__('media_metrics') 16 super(Media, self).__init__('media_metrics')
16 self._media_metric = None 17 self._media_metric = None
17 18
18 def results_are_the_same_on_every_page(self): 19 def results_are_the_same_on_every_page(self):
19 """Results can vary from page to page based on media events taking place.""" 20 """Results can vary from page to page based on media events taking place."""
20 return False 21 return False
21 22
22 def DidNavigateToPage(self, page, tab): 23 def DidNavigateToPage(self, page, tab):
23 """Override to do operations right after the page is navigated.""" 24 """Override to do operations right after the page is navigated."""
24 self._media_metric = media.MediaMetric(tab) 25 self._media_metric = media.MediaMetric(tab)
25 self._media_metric.Start(page, tab) 26 self._media_metric.Start(page, tab)
26 27
27 def MeasurePage(self, page, tab, results): 28 def MeasurePage(self, page, tab, results):
28 """Measure the page's performance.""" 29 """Measure the page's performance."""
29 self._media_metric.Stop(page, tab) 30 self._media_metric.Stop(page, tab)
30 self._media_metric.AddResults(tab, results) 31 self._media_metric.AddResults(tab, results)
32
OLDNEW
« no previous file with comments | « no previous file | tools/perf/metrics/media.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698