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

Unified Diff: chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py

Issue 7745007: Pyauto performance tests now output data to be graphed using autotest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | chrome/test/functional/perf.py » ('j') | chrome/test/functional/perf.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py
diff --git a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py
index ce2e29e005e891dfa8abbe428344b6bd9d447ea4..b811197a10750380bc5c839db48b62ebb89ce2e4 100644
--- a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py
+++ b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py
@@ -16,6 +16,8 @@ class desktopui_PyAutoPerfTests(chrome_test.ChromeTestBase):
Performs all setup and fires off the CHROMEOS_PERF PyAuto suite.
"""
+ _PERF_DATA_FILE = '/usr/local/tmp/perf_data.txt'
Nirnimesh 2011/08/25 00:23:36 use tempfile.tempdir()
dennis_jeffrey 2011/08/25 01:30:35 I no longer use a temp file at all.
+
version = 1
def initialize(self):
@@ -70,8 +72,27 @@ class desktopui_PyAutoPerfTests(chrome_test.ChromeTestBase):
os.path.join(pyautolib_dir, 'chromeos', 'chromeos_utils.py'))
utils.system(login_cmd)
+ # Remove the performance data file if it exists.
+ if os.path.exists(self._PERF_DATA_FILE):
+ try:
Nirnimesh 2011/08/25 00:23:36 Do not try
dennis_jeffrey 2011/08/25 01:30:35 This code has been removed.
+ os.remove(self._PERF_DATA_FILE)
+ except OSError, e:
+ print 'Warning: Could not remove output file "%s": %s' % (
+ self._PERF_DATA_FILE, e)
+
# Run the PyAuto performance tests.
functional_cmd = cros_ui.xcommand_as(
'%s/chrome_test/test_src/chrome/test/functional/'
'pyauto_functional.py --suite=CHROMEOS_PERF -v' % deps_dir)
utils.system(functional_cmd)
+
+ # Output the performance data from the temporary performance data file
+ # into a format that can be graphed.
+ if os.path.exists(self._PERF_DATA_FILE):
+ try:
Nirnimesh 2011/08/25 00:23:36 Do not try. Just do it. If something bad happens i
dennis_jeffrey 2011/08/25 01:30:35 The try has since been removed.
+ with open(self._PERF_DATA_FILE, 'r') as f:
+ lines = [line for line in f.readlines() if line.strip()]
+ perf_dict = dict([eval(line) for line in lines])
+ self.write_perf_keyval(perf_dict)
+ except IOError, e:
+ print 'Warning: could not process performance data file: ' + str(e)
« no previous file with comments | « no previous file | chrome/test/functional/perf.py » ('j') | chrome/test/functional/perf.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698