summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordennisjeffrey@chromium.org <dennisjeffrey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-20 05:28:05 +0000
committerdennisjeffrey@chromium.org <dennisjeffrey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-20 05:28:05 +0000
commit02093cffb66d1d81f070a8d085ef1ef0dd4d6ba8 (patch)
treec93aac1824383ff9fc055cf24af0b72119eb7f36
parent1bd0ef17d0ab01a5d4e9fd83fca7c1a70de2a1e7 (diff)
downloadchromium_src-02093cffb66d1d81f070a8d085ef1ef0dd4d6ba8.zip
chromium_src-02093cffb66d1d81f070a8d085ef1ef0dd4d6ba8.tar.gz
chromium_src-02093cffb66d1d81f070a8d085ef1ef0dd4d6ba8.tar.bz2
Added some comments and a warning message to pyauto perf tests in perf.py.
Since performance key values (descriptions) are truncated to 30 characters before they are stored into the autotest database, a warning message is now printed in perf.py in the event that a perf description > length 30 is outputted. BUG=None TEST=None Review URL: http://codereview.chromium.org/8342055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106457 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/test/functional/perf.py32
1 files changed, 23 insertions, 9 deletions
diff --git a/chrome/test/functional/perf.py b/chrome/test/functional/perf.py
index b23b9ee..cb059cd 100644
--- a/chrome/test/functional/perf.py
+++ b/chrome/test/functional/perf.py
@@ -112,19 +112,33 @@ class BasePerfTest(pyauto.PyUITest):
def _OutputPerfGraphValue(self, description, value):
"""Outputs a performance value to have it graphed on the performance bots.
- Only used for ChromeOS.
+ Only used for ChromeOS. The performance bots have a 30-character limit on
+ the length of the description for a performance value. Any characters
+ beyond that are truncated before results are stored in the autotest
+ database.
Args:
- description: A string description of the performance value.
+ description: A string description of the performance value. This will
+ be truncated to 30 characters when stored in the autotest
+ database.
value: A numeric value representing a single performance measurement.
"""
if self.IsChromeOS():
+ if len(description) > 30:
+ logging.warning('The description "%s" will be truncated to "%s" '
+ '(length 30) when added to the autotest database.',
+ description, description[:30])
print '\n%s(\'%s\', %.2f)%s' % (self._PERF_OUTPUT_MARKER_PRE, description,
value, self._PERF_OUTPUT_MARKER_POST)
def _PrintSummaryResults(self, description, values, units):
"""Logs summary measurement information.
+ This function computes and outputs the average and standard deviation of
+ the specified list of value measurements. It also invokes
+ _OutputPerfGraphValue() with the computed *average* value, to ensure the
+ average value can be plotted in a performance graph.
+
Args:
description: A string description for the specified results.
values: A list of numeric value measurements.
@@ -595,7 +609,7 @@ class FlashTest(BasePerfTest):
timeout=300, expect_retval=True, retry_sleep=0.25),
msg='Timed out when waiting for test result.')
result = float(self.ExecuteJavascript(js, tab_index=1))
- logging.info('Result for %s: %.2f FPS (average)' % (description, result))
+ logging.info('Result for %s: %.2f FPS (average)', description, result)
self._OutputPerfGraphValue('%s_%s' % ('FPS', description), result)
def testFlashGaming(self):
@@ -643,8 +657,8 @@ class FlashTest(BasePerfTest):
if benchmark.endswith('_mflops'):
benchmark = benchmark[:benchmark.find('_mflops')]
logging.info('Results for ScimarkGui_' + benchmark + ':')
- logging.info(' %.2f MFLOPS' % mflops)
- logging.info(' %.2f MB' % mem)
+ logging.info(' %.2f MFLOPS', mflops)
+ logging.info(' %.2f MB', mem)
self._OutputPerfGraphValue(
'%s_ScimarkGui-%s-MFLOPS' % ('MFLOPS', benchmark), mflops)
self._OutputPerfGraphValue(
@@ -678,7 +692,7 @@ class PerfTestServerRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
megabytes = int(args['mb'][0])
filename = args['filename'][0]
except (ValueError, KeyError, IndexError), e:
- logging.exception('Server error creating file: %s' % e)
+ logging.exception('Server error creating file: %s', e)
assert megabytes and filename
with open(os.path.join(self.server.docroot, filename), 'wb') as f:
f.write('X' * 1024 * 1024 * megabytes)
@@ -697,12 +711,12 @@ class PerfTestServerRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
try:
filename = args['filename'][0]
except (KeyError, IndexError), e:
- logging.exception('Server error deleting file: %s' % e)
+ logging.exception('Server error deleting file: %s', e)
assert filename
try:
os.remove(os.path.join(self.server.docroot, filename))
except OSError, e:
- logging.warning('OS error removing file: %s' % e)
+ logging.warning('OS error removing file: %s', e)
self.send_response(200)
self.end_headers()
@@ -721,7 +735,7 @@ class PerfTestServerRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
try:
megabytes = int(args['mb'][0])
except (ValueError, KeyError, IndexError), e:
- logging.exception('Server error starting upload: %s' % e)
+ logging.exception('Server error starting upload: %s', e)
assert megabytes
script = """
<html>