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

Unified Diff: tools/perf/measurements/usecounter.py

Issue 2572003003: NOT FOR SUBMIT: use counters for jdm@
Patch Set: Merge branch 'jdm-usecounters' into jdm-merge Created 4 years 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/benchmarks/usecounter.py ('k') | tools/perf/metrics/usecounter.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/usecounter.py
diff --git a/tools/perf/measurements/usecounter.py b/tools/perf/measurements/usecounter.py
new file mode 100644
index 0000000000000000000000000000000000000000..8734d58011a896eda061703d1aaf564e00923c33
--- /dev/null
+++ b/tools/perf/measurements/usecounter.py
@@ -0,0 +1,26 @@
+# Copyright 2016 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 telemetry.page import legacy_page_test
+
+from metrics import usecounter
+
+class UseCounter(legacy_page_test.LegacyPageTest):
+
+ def __init__(self, needs_browser_restart_after_each_page=False):
+ super(UseCounter, self).__init__(needs_browser_restart_after_each_page)
+ self._metric = usecounter.UseCounterMetric()
+
+ @classmethod
+ def CustomizeBrowserOptions(cls, options):
+ usecounter.UseCounterMetric.CustomizeBrowserOptions(options)
+
+ def WillNavigateToPage(self, page, tab):
+ self._metric.Start(page, tab)
+
+ def DidNavigateToPage(self, page, tab):
+ self._metric.Stop(page, tab)
+
+ def ValidateAndMeasurePage(self, page, tab, results):
+ self._metric.AddResults(tab, results)
« no previous file with comments | « tools/perf/benchmarks/usecounter.py ('k') | tools/perf/metrics/usecounter.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698