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

Unified Diff: tools/perf/contrib/cluster_telemetry/screenshot_ct.py

Issue 2923163007: Implemented telemetry benchmark that loads page and outputs screenshot. (Closed)
Patch Set: Addex pixel assert to unit test Created 3 years, 6 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: tools/perf/contrib/cluster_telemetry/screenshot_ct.py
diff --git a/tools/perf/contrib/cluster_telemetry/screenshot_ct.py b/tools/perf/contrib/cluster_telemetry/screenshot_ct.py
new file mode 100644
index 0000000000000000000000000000000000000000..329a3d8ccfe1bf82956e268020b1994005d6ae1a
--- /dev/null
+++ b/tools/perf/contrib/cluster_telemetry/screenshot_ct.py
@@ -0,0 +1,42 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from core import perf_benchmark
+
+from contrib.cluster_telemetry import ct_benchmarks_util
+from contrib.cluster_telemetry import page_set
+from contrib.cluster_telemetry import repaint_helpers
+from contrib.cluster_telemetry import screenshot
+
+class ScreenshotCT(perf_benchmark.PerfBenchmark):
+ """Captures PNG screenshots of web pages for Cluster Telemetry. Screenshots
+ written to local file with path-safe urls of pages as filenames. Cluster
+ Telemetry is then used for aggregation and analysis."""
+
+ @classmethod
+ def Name(cls):
+ return 'screenshot_ct'
+
+ @classmethod
+ def AddBenchmarkCommandLineArgs(cls, parser):
+ ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser)
+ parser.add_option('--png-outdir', type='string',
+ default=None,
+ help='Output directory for the PNG files')
+ parser.add_option('--wait-time', type='float', default=0,
+ help='Wait time before the benchmark is started')
+
+ @classmethod
+ def ProcessCommandLineArgs(cls, parser, args):
+ ct_benchmarks_util.ValidateCommandLineArgs(parser, args)
+ if not args.png_outdir:
+ parser.error('Please specify --png-outdir')
+
+ def CreatePageTest(self, options):
+ return screenshot.Screenshot(options.png_outdir)
+
+ def CreateStorySet(self, options):
+ return page_set.CTPageSet(
+ options.urls_list, options.user_agent, options.archive_data_file,
+ run_page_interaction_callback=repaint_helpers.WaitThenRepaint)
« no previous file with comments | « tools/perf/contrib/cluster_telemetry/screenshot.py ('k') | tools/perf/contrib/cluster_telemetry/screenshot_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698