Commit 0d147f80 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

make a profile report for each iteration.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24963 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b975b47d
...@@ -140,8 +140,8 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -140,8 +140,8 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
self.failUnless(min < req_time < max, self.failUnless(min < req_time < max,
'%.4f < %.4f < %.4f' % (min, req_time, max)) '%.4f < %.4f < %.4f' % (min, req_time, max))
def profile(self, func): def profile(self, func, suffix=''):
prof_file = func.__name__ prof_file = '%s%s' % (func.__name__, suffix)
try: try:
os.unlink(prof_file) os.unlink(prof_file)
except OSError: except OSError:
...@@ -210,7 +210,7 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -210,7 +210,7 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
add_result[key] = (after_add - before_add)/100. add_result[key] = (after_add - before_add)/100.
if PROFILE: if PROFILE:
self.profile(self.bar_module.BarModule_viewBarList) self.profile(self.bar_module.BarModule_viewBarList, i)
keys = view_result.keys() keys = view_result.keys()
keys.sort() keys.sort()
# first display results # first display results
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment