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

Unified Diff: build/android/pylib/surface_stats_collector.py

Issue 12513011: Telemetry / Android: further cleanup on surface_stats_collector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/telemetry/telemetry/core/chrome/android_platform_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/surface_stats_collector.py
diff --git a/build/android/pylib/surface_stats_collector.py b/build/android/pylib/surface_stats_collector.py
index 42e0874534e5165f65b8df8f4c2d342617d289b9..ca41355cae703e75c704526b1c26f4aa180d4fb4 100644
--- a/build/android/pylib/surface_stats_collector.py
+++ b/build/android/pylib/surface_stats_collector.py
@@ -28,19 +28,20 @@ class SurfaceStatsCollector(object):
self.value = value
self.unit = unit
- def __init__(self, adb, trace_tag):
+ def __init__(self, adb, trace_tag=''):
self._adb = adb
- self._trace_tag = trace_tag
self._collector_thread = None
self._use_legacy_method = False
self._surface_before = None
self._get_data_event = None
self._data_queue = None
self._stop_event = None
- self._print_perf_results = True
self._results = []
def __enter__(self):
+ self.Start()
+
+ def Start(self):
assert not self._collector_thread
if self._ClearSurfaceFlingerLatencyData():
@@ -54,8 +55,10 @@ class SurfaceStatsCollector(object):
self._surface_before = self._GetSurfaceStatsLegacy()
def __exit__(self, *args):
+ self.Stop()
+
+ def Stop(self):
self._StorePerfResults()
- self._PrintPerfResults()
if self._collector_thread:
self._stop_event.set()
self._collector_thread.join()
@@ -64,16 +67,6 @@ class SurfaceStatsCollector(object):
def GetResults(self):
return self._results
- def SuppressPrintingResults(self):
- self._print_perf_results = False
-
- def _PrintPerfResults(self):
- if not self._print_perf_results:
- return
- for r in self._results:
- perf_tests_helper.PrintPerfResult(r.name, r.name + self._trace_tag,
- r.value, r.unit)
-
def _StorePerfResults(self):
if self._use_legacy_method:
surface_after = self._GetSurfaceStatsLegacy()
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/chrome/android_platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698