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

Unified Diff: build/android/run_tests.py

Issue 8769020: Android bot changes for robustness, profiling, and debugging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « build/android/emulator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/run_tests.py
diff --git a/build/android/run_tests.py b/build/android/run_tests.py
index 19e1672b8c4f4f25da81bf2a2bc5f35f675fd236..61b01d7227a990ec2276930c9e10d9f0baf06c9d 100755
--- a/build/android/run_tests.py
+++ b/build/android/run_tests.py
@@ -65,6 +65,25 @@ from test_result import BaseTestResult, TestResults
_TEST_SUITES = ['base_unittests', 'sql_unittests', 'ipc_tests', 'net_unittests']
+
+class TimeProfile(object):
+ """Class for simple profiling of action, with logging of cost."""
+
+ def __init__(self, description):
+ self._description = description
+ self.Start()
+
+ def Start(self):
+ self._starttime = time.time()
+
+ def Stop(self):
+ """Stop profiling and dump a log."""
+ if self._starttime:
+ stoptime = time.time()
+ logging.info('%fsec to perform %s' %
+ (stoptime - self._starttime, self._description))
+ self._starttime = None
+
class Xvfb(object):
"""Class to start and stop Xvfb if relevant. Nop if not Linux."""
@@ -194,8 +213,11 @@ def Dispatch(options):
xvfb.Start()
if options.use_emulator:
+ t = TimeProfile('Emulator launch')
buildbot_emulator = emulator.Emulator()
+ buildbot_emulator.Reset()
buildbot_emulator.Launch()
+ t.Stop()
attached_devices.append(buildbot_emulator.device)
else:
attached_devices = android_commands.GetAttachedDevices()
« no previous file with comments | « build/android/emulator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698