pax_global_header 0000666 0000000 0000000 00000000064 13556445331 0014523 g ustar 00root root 0000000 0000000 52 comment=399c411406121f93cc8b710d82f8e8940d72c976
4d9f246361855ca60855d5c52a9b6417a3591aae.paxheader 0000666 0000000 0000000 00000000176 13556445331 0020315 x ustar 00root root 0000000 0000000 126 path=erp5-399c411406121f93cc8b710d82f8e8940d72c976-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/
4d9f246361855ca60855d5c52a9b6417a3591aae.data 0000775 0000000 0000000 00000000000 13556445331 0017145 5 ustar 00root root 0000000 0000000 erp5_administration/ 0000775 0000000 0000000 00000000000 13556445331 0040621 5 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration SkinTemplateItem/ 0000775 0000000 0000000 00000000000 13556445331 0044040 5 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration portal_skins/ 0000775 0000000 0000000 00000000000 13556445331 0046550 5 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem portal_skins/erp5_administration/ 0000775 0000000 0000000 00000000000 13556445331 0052530 5 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem portal_skins/erp5_administration/ERP5Site_getProfiler.xml 0000664 0000000 0000000 00000002640 13556445331 0057156 0 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-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 13556445331 0063134 0 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-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 13556445331 0057533 0 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-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 13556445331 0057702 0 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-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 13556445331 0057527 0 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-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 13556445331 0057700 0 ustar 00root root 0000000 0000000 erp5-399c411406121f93cc8b710d82f8e8940d72c976-erp5_administration-SkinTemplateItem-portal_skins-erp5_administration/erp5_administration/SkinTemplateItem
Script_magic3_bind_names_paramsduration=60, base_name=None, zipfile=TrueguardAAAAAAAAAAI=idERP5Site_profileProcessrolesManager