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

Unified Diff: chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py

Issue 1843063004: Add new Telemetry tests to get CPU and memory usage for idle and flinging two test scenarios. Mirro… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN build failure Created 4 years, 8 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
Index: chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py
diff --git a/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py b/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py
index 78356cee045301c2dada7afcd6277263bc60422d..e8d1b692d26933020caf4e216223f81de4860a7b 100644
--- a/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py
+++ b/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py
@@ -9,7 +9,7 @@ from core import path_util
from telemetry.timeline import tracing_category_filter
from telemetry.web_perf import timeline_based_measurement
-from benchmarks.pagesets import media_router_pages
+from benchmarks.pagesets import media_router_perf_pages
from benchmarks import media_router_measurements
from benchmarks import media_router_timeline_metric
@@ -17,26 +17,28 @@ from benchmarks import media_router_timeline_metric
class _BaseCastBenchmark(perf_benchmark.PerfBenchmark):
options = {'page_repeat': 6}
- page_set = media_router_pages.MediaRouterPageSet
+ page_set = media_router_perf_pages.MediaRouterDialogPageSet
def SetExtraBrowserOptions(self, options):
options.clear_sytem_cache_for_browser_and_profile_on_start = True
+ # This flag is required to enable the communication between the page and
+ # the test extension.
+ options.disable_background_networking = False
+
# TODO: find a better way to find extension location.
options.AppendExtraBrowserArgs([
- '--load-extension=' + os.path.join(path_util.GetChromiumSrcDir(), 'out',
- 'Release', 'mr_extension', 'release'),
+ '--load-extension=' + ','.join([
+ os.path.join(path_util.GetChromiumSrcDir(), 'out',
+ 'Release', 'mr_extension', 'release'),
+ os.path.join(path_util.GetChromiumSrcDir(), 'out',
+ 'Release', 'media_router', 'test_extension')]),
'--whitelisted-extension-id=enhhojjnijigcajfphajepfemndkmdlo',
'--media-router=1',
'--enable-stats-collection-bindings'
])
- @classmethod
- def ValueCanBeAddedPredicate(cls, value, is_first_result):
- """Only drops the first result."""
- return not is_first_result
-
-class TraceEventCaseBenckmark(_BaseCastBenchmark):
+class TraceEventCastBenckmark(_BaseCastBenchmark):
def CreateTimelineBasedMeasurementOptions(self):
media_router_category = 'media_router'
@@ -52,14 +54,35 @@ class TraceEventCaseBenckmark(_BaseCastBenchmark):
def Name(cls):
return 'media_router.dialog.latency.tracing'
+ @classmethod
+ def ValueCanBeAddedPredicate(cls, value, is_first_result):
+ """Only drops the first result."""
+ return not is_first_result
+
-class HistogramCaseBenckmark(_BaseCastBenchmark):
+class HistogramCastBenckmark(_BaseCastBenchmark):
def CreatePageTest(self, options):
- return media_router_measurements.MediaRouterPageTest()
+ return media_router_measurements.MediaRouterDialogTest()
@classmethod
def Name(cls):
return 'media_router.dialog.latency.histogram'
+ @classmethod
+ def ValueCanBeAddedPredicate(cls, value, is_first_result):
+ """Only drops the first result."""
+ return not is_first_result
+
+
+class CPUMemoryCastBenckmark(_BaseCastBenchmark):
+ options = {'page_repeat': 1}
+ page_set = media_router_perf_pages.MediaRouterCPUMemoryPageSet
+
+ def CreatePageTest(self, options):
+ return media_router_measurements.MediaRouterCPUMemoryTest()
+
+ @classmethod
+ def Name(cls):
+ return 'media_router.cpu_memory'

Powered by Google App Engine
This is Rietveld 408576698