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

Unified 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: Access page-set property at the start of gathering metrics, to identify whether or not to skip logg… Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/perf/metrics/media.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/media.py
diff --git a/tools/perf/measurements/media.py b/tools/perf/measurements/media.py
index 4d2ffcffe6599ba9b1e3010dd7bf53f9575d7aed..ea973f7312f8ce35da65ccefea8a2837830fc45a 100644
--- a/tools/perf/measurements/media.py
+++ b/tools/perf/measurements/media.py
@@ -2,8 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
+import sys
+
from metrics import media
from telemetry.page import page_measurement
+from telemetry.page import page_set
+
class Media(page_measurement.PageMeasurement):
"""The MediaMeasurement class gathers media-related metrics on a page set.
@@ -15,6 +20,19 @@ class Media(page_measurement.PageMeasurement):
super(Media, self).__init__('media_metrics')
self._media_metric = None
+ def CreatePageSet(self, args, options):
dtu 2013/08/30 19:38:34 Are you still using this? Remove?
anandc 2013/08/30 20:18:51 Thanks for the catch. Removed.
+ if len(args) < 2:
+ print 'Must specify a file or directory to run.'
+ sys.exit(1)
+
+ page_set_arg = args[1]
+
+ if not os.path.exists(page_set_arg):
+ print '%s does not exist.' % page_set_arg
+ sys.exit(1)
+
+ return page_set.PageSet.FromFile(page_set_arg)
+
def results_are_the_same_on_every_page(self):
"""Results can vary from page to page based on media events taking place."""
return False
@@ -28,3 +46,4 @@ class Media(page_measurement.PageMeasurement):
"""Measure the page's performance."""
self._media_metric.Stop(page, tab)
self._media_metric.AddResults(tab, results)
+
« 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