pax_global_header 0000666 0000000 0000000 00000000064 13556512326 0014522 g ustar 00root root 0000000 0000000 52 comment=0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1
c44a59c239b3d5acfc0b585cb51cb30ea5aca200.paxheader 0000666 0000000 0000000 00000000176 13556512326 0020765 x ustar 00root root 0000000 0000000 126 path=erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/
c44a59c239b3d5acfc0b585cb51cb30ea5aca200.data 0000775 0000000 0000000 00000000000 13556512326 0017615 5 ustar 00root root 0000000 0000000 erp5_administration/ 0000775 0000000 0000000 00000000000 13556512326 0041343 5 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration SkinTemplateItem/ 0000775 0000000 0000000 00000000000 13556512326 0044562 5 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration portal_skins/ 0000775 0000000 0000000 00000000000 13556512326 0047272 5 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem portal_skins/erp5_administration/ 0000775 0000000 0000000 00000000000 13556512326 0053252 5 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem portal_skins/erp5_administration/ERP5Site_getProfiler.xml 0000664 0000000 0000000 00000002640 13556512326 0057700 0 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem
_functiongetProfiler_modulepprofileguardAAAAAAAAAAI=idERP5Site_getProfilertitlerolesManager
portal_skins/erp5_administration/ERP5Site_getStatisticalProfilerAndThread.xml 0000664 0000000 0000000 00000002710 13556512326 0063656 0 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem
_functiongetStatisticalProfilerAndThread_modulepprofileguardAAAAAAAAAAI=idERP5Site_getStatisticalProfilerAndThreadtitlerolesManager
portal_skins/erp5_administration/ERP5Site_profileContext.py 0000664 0000000 0000000 00000004433 13556512326 0060255 0 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem """
Profile the whole execution of a callable.
Always raises, in order to allow profiling repeatedly in the same initial conditions code which would otherwise modify databases.
Writes result to response directly.
args (tuple)
kw (dict)
Positional and keyword arguments to pass to profiled callable.
func (None, callable)
Profiled callable, or context if not provided.
statistic (bool)
Whether to use deterministic or statistic profiling.
Deterministic is more detailed and easier to read, but has a very large performance cost (10x slower). It is best suited for profiling code which normally runs in a few seconds.
Statistic is less detailed and harder to read, but has an extremely small performance cost. It is best suited for profiling code which normally takes at least 10s to run.
base_name (None, str):
Value to include in the name of result file, to help categorise your own results.
When None, produced file names are of the format: {cachegrind.out.|statistical_}YYYYmmddHHMMSS{|.zip}
Otherwise, produced file names are of the format: {cachegrind.out.|statistical_}${base_name}_YYYYmmddHHMMSS{|.zip}
zipfile (bool)
When true, the result is a zip file containing profiling result along with the python code (and, when not possible, the disassembled bytecode) of all files which appear in the profiling result.
When false, the result is a bare profiling result (cachegrind file format).
"""
from StringIO import StringIO
portal = context.getPortalObject()
if statistic:
profiler, retriever = portal.ERP5Site_getStatisticalProfilerAndThread(single=True)
else:
profiler = retriever = portal.ERP5Site_getProfiler()
kw = dict(kw)
if func is None:
func = context
with retriever:
func(*args, **kw)
response = context.REQUEST.RESPONSE
filename = DateTime().strftime('%Y%m%d%H%M%S')
if base_name:
filename = base_name + '_' + filename
if zipfile:
data, content_type = profiler.asZip()
filename = 'statistical_' + filename + '.zip'
else:
out = StringIO()
profiler.callgrind(out, relative_path=True)
data = out.getvalue()
content_type = 'application/x-kcachegrind'
filename = 'cachegrind.out.' + filename
response.setHeader('content-type', content_type)
response.setHeader('content-disposition', 'attachment; filename="' + filename + '"')
response.write(data)
raise Exception('profiling')
portal_skins/erp5_administration/ERP5Site_profileContext.xml 0000664 0000000 0000000 00000005620 13556512326 0060424 0 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem
Script_magic3_bind_names_paramsargs=(), kw=(), func=None, statistic=False, base_name=None, zipfile=TrueguardAAAAAAAAAAI=idERP5Site_profileContextrolesManager
portal_skins/erp5_administration/ERP5Site_profileProcess.py 0000664 0000000 0000000 00000003436 13556512326 0060251 0 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem """
Profile all threads from current process.
Spawns an extra thread (which is ignored in the profiling) to periodically take snapshots of all threads' call stacks.
The source code line of each innermost stack entry gets one hit, and all its callers are remembered as such.
Returns result and sets some response headers.
duration (number):
How long to sample for.
Larger values will produce more detailed results.
Smaller values will produce more noisy results.
base_name (None, str):
Value to include in the name of result file, to help categorise your own results.
When None, produced file names are of the format: {cachegrind.out.|statistical_}YYYYmmddHHMMSS{|.zip}
Otherwise, produced file names are of the format: {cachegrind.out.|statistical_}${base_name}_YYYYmmddHHMMSS{|.zip}
zipfile (bool)
When true, the result is a zip file containing profiling result along with the python code (and, when not possible, the disassembled bytecode) of all files which appear in the profiling result.
When false, the result is a bare profiling result (cachegrind file format).
"""
from time import sleep
from StringIO import StringIO
profiler, thread = context.ERP5Site_getStatisticalProfilerAndThread(single=False)
with thread:
sleep(duration)
response = context.REQUEST.RESPONSE
filename = DateTime().strftime('%Y%m%d%H%M%S')
if base_name:
filename = base_name + '_' + filename
if zipfile:
data, content_type = profiler.asZip()
filename = 'statistical_' + filename + '.zip'
else:
out = StringIO()
profiler.callgrind(out, relative_path=True)
data = out.getvalue()
content_type = 'application/x-kcachegrind'
filename = 'cachegrind.out.' + filename
response.setHeader('content-type', content_type)
response.setHeader('content-disposition', 'attachment; filename="' + filename + '"')
return data
portal_skins/erp5_administration/ERP5Site_profileProcess.xml 0000664 0000000 0000000 00000005561 13556512326 0060422 0 ustar 00root root 0000000 0000000 erp5-0024e8ac7a73ce6d0abfba1a0f6f3573bd4360d1-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem
Script_magic3_bind_names_paramsduration=60, base_name=None, zipfile=TrueguardAAAAAAAAAAI=idERP5Site_profileProcessrolesManager