Commit 83d407a1 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

get more profile results if PROFILE=1.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29955 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eace410c
......@@ -189,15 +189,23 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
add_result = {}
# add object in bar module
for i in xrange(10):
def add():
for x in xrange(100):
p = self.bar_module.newContent(portal_type='Bar',
title='Bar Test',
quantity="%4d" %(x,))
before_add = time()
for x in xrange(100):
p = self.bar_module.newContent(portal_type='Bar',
title='Bar Test',
quantity="%4d" %(x,))
if PROFILE:
self.profile(add, i)
else:
add()
after_add = time()
transaction.commit()
before_tic = time()
self.tic()
if PROFILE:
self.profile(self.tic, i)
else:
self.tic()
after_tic = time()
gc.collect()
before_form = time()
......@@ -276,6 +284,8 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
( MIN_OBJECT_PROXYFIELD_VIEW,
req_time,
MAX_OBJECT_PROXYFIELD_VIEW )
if PROFILE:
self.profile(foo.Foo_viewProxyField)
if DO_TEST:
self.failUnless( MIN_OBJECT_PROXYFIELD_VIEW < req_time
< MAX_OBJECT_PROXYFIELD_VIEW,
......
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