{ "info": { "author": "yboussard", "author_email": "yboussard@alterway.fr", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Framework :: Zope2", "Framework :: Zope3", "Intended Audience :: Developers", "Programming Language :: Python", "Topic :: Utilities" ], "description": "Introduction\r\n============\r\n\r\ncollective.profiler is a tool that helps developers to analyze code performance.\r\nIt patch code via an zcml declaration.\r\nIt use the very good **profilehooks** package in internal. collective.profiler is just an interface to this tool\r\n\r\nThere is two directives :\r\n\r\n* **timecall** -> give you the number of seconds by calls\r\n\r\nExample ::\r\n\r\n \r\n \r\n \r\n\r\ngive you some information about the call of listFilteredActionsFor method \r\n\r\nWhen you start in fg your zopeinstance you can see after the start ::\r\n\r\n listFilteredActionsFor (.../eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/ActionsTool.py:94):\r\n 1 calls, 0.238 seconds (0.238 seconds per call)\r\n\r\n* **profile** -> print the results of profiling \r\n\r\nExemple :: \r\n\r\n \r\n \r\n \r\n\r\nWhen you start in fg your zopeinstance you can see after the start ::\r\n\r\n *** PROFILER RESULTS ***\r\n listFilteredActionsFor (/Users/yboussard/.virtualenvs/dpldt/buildout/eggs/Plone-3.3.5-py2.4.egg/Products/CMFPlone/ActionsTool.py:94)\r\n function called 1 times\r\n\r\n 228731 function calls (211122 primitive calls) in 1.730 CPU seconds\r\n\r\n Ordered by: cumulative time, internal time, call count\r\n List reduced from 871 to 40 due to restriction <40>\r\n\r\n ncalls tottime percall cumtime percall filename:lineno(function)\r\n 1 0.000 0.000 1.730 1.730 profile:0()\r\n 1 0.000 0.000 1.729 1.729 ActionsTool.py:94(listFilteredActionsFor)\r\n 1 0.001 0.001 1.676 1.676 ActionsTool.py:44(listActionInfos)\r\n 195/167 0.002 0.000 1.622 0.010 ActionInformation.py:197(__getitem__)\r\n 18 0.001 0.000 1.612 0.090 Expression.py:40(__call__)\r\n 6 0.000 0.000 1.221 0.204 ProfilerPatch.py:19(__patched_call__)\r\n 6 0.000 0.000 1.221 0.203 expressions.py:214(__call__)\r\n 6 0.000 0.000 1.221 0.203 Expressions.py:144(_eval)\r\n 6 0.000 0.000 1.086 0.181 Expressions.py:108(render)\r\n 33 0.000 0.000 0.868 0.026 RCompile.py:68(compileAndTuplize)\r\n 33 0.001 0.000 0.867 0.026 RCompile.py:62(compile)\r\n 10 0.000 0.000 0.767 0.077 FSObject.py:168(_updateFromFS)\r\n 7 0.000 0.000 0.766 0.109 FSPythonScript.py:117(_readFile)\r\n 7 0.000 0.000 0.765 0.109 FSPythonScript.py:255(_write)\r\n 21 0.000 0.000 0.752 0.036 PythonScript.py:275(_makeFunction)\r\n 21 0.001 0.000 0.751 0.036 PythonScript.py:232(_compile)\r\n 21 0.000 0.000 0.746 0.036 PythonScript.py:229(_compiler)\r\n 21 0.000 0.000 0.746 0.036 RCompile.py:75(compile_restricted_function)\r\n 8/3 0.000 0.000 0.693 0.231 FSPythonScript.py:137(__call__)\r\n 10/4 0.000 0.000 0.611 0.153 Bindings.py:331(_bindAndExec)\r\n 10/4 0.001 0.000 0.608 0.152 FSPythonScript.py:144(_exec)\r\n 1 0.000 0.000 0.568 0.568 flashupload.py:65(can_upload)\r\n 1 0.000 0.000 0.560 0.560 flashupload.py:62(allowed_types)\r\n 8/3 0.000 0.000 0.545 0.182 Bindings.py:311(__call__)\r\n 2 0.000 0.000 0.515 0.258 ZRPythonExpr.py:66(call_with_ns)\r\n 2 0.000 0.000 0.511 0.255 FSPythonScript.py:132(__render_with_namespace__)\r\n 1 0.000 0.000 0.469 0.469 Script (Python):1(getAllowedTypes)\r\n 319 0.003 0.000 0.396 0.001 Connection.py:749(setstate)\r\n 319 0.009 0.000 0.393 0.001 Connection.py:769(_setstate)\r\n 7 0.003 0.000 0.345 0.049 PythonScript.py:395(write)\r\n 33 0.001 0.000 0.338 0.010 RCompile.py:53(_get_tree)\r\n 319 0.005 0.000 0.321 0.001 serialize.py:603(setGhostState)\r\n 319 0.005 0.000 0.314 0.001 serialize.py:593(getState)\r\n 1289/638 0.023 0.000 0.301 0.000 :0(load)\r\n 208/108 0.002 0.000 0.280 0.003 visitor.py:101(walk)\r\n 208/108 0.002 0.000 0.278 0.003 visitor.py:59(preorder)\r\n 3858/108 0.049 0.000 0.277 0.003 visitor.py:42(dispatch)\r\n 56/33 0.000 0.000 0.276 0.008 pycodegen.py:241(getCode)\r\n 56/33 0.002 0.000 0.276 0.008 pyassem.py:365(getCode)\r\n 1 0.000 0.000 0.272 0.272 constraintypes.py:243(allowedContentTypes)\r\n\r\nOptions\r\n=======\r\n\r\ntimecall\r\n--------\r\n\r\n * immediate : If you want just a summary at program termination, use False\r\n\r\nprofile\r\n-------\r\n \r\n * skip : If `skip` is > 0, first `skip` calls to `fn` will not be profiled.\r\n \r\n * filename : If `filename` is specified, the profile stats will be stored in the named file. You can analyse it with profiler tool or pstats.Stats(filename).\r\n \r\n * If `immediate` is False, profiling results will be printed to\r\n sys.stdout on program termination.\r\n\r\n * If `dirs` is False only the name of the file will be printed.\r\n Otherwise the full path is used.\r\n \r\n * `sort` can be a list of sort keys (defaulting to ['cumulative',\r\n 'time', 'calls']). The following ones are recognized::\r\n\r\n 'calls' -- call count\r\n 'cumulative' -- cumulative time\r\n 'file' -- file name\r\n 'line' -- line number\r\n 'module' -- file name\r\n 'name' -- function name\r\n 'nfl' -- name/file/line\r\n 'pcalls' -- call count\r\n 'stdname' -- standard name\r\n 'time' -- internal time\r\n\r\n * `entries` limits the output to the first N entries.\r\n \r\n \r\n\r\nChangelog\r\n=========\r\n\r\n0.3 (2011-05-12)\r\n----------------\r\n\r\n- Nothing changed yet.\r\n\r\n\r\n0.2 (2011-05-12)\r\n----------------\r\n\r\n- Add some information in setup.py\r\n\r\n\r\n0.1 (2011-05-12)\r\n----------------\r\n\r\n- Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/collective/collective.profiler", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "collective.profiler", "package_url": "https://pypi.org/project/collective.profiler/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.profiler/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/collective/collective.profiler" }, "release_url": "https://pypi.org/project/collective.profiler/0.3/", "requires_dist": null, "requires_python": null, "summary": "declare function for profile in zcml", "version": "0.3" }, "last_serial": 755011, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "0f219fca8e9724607aa6e8b48a6167cc", "sha256": "a85f6f9b23e3b8ca28736335b82575cc862bd1180733b98cb1fd1de8615e2917" }, "downloads": -1, "filename": "collective.profiler-0.3.zip", "has_sig": false, "md5_digest": "0f219fca8e9724607aa6e8b48a6167cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14701, "upload_time": "2011-05-12T14:27:34", "url": "https://files.pythonhosted.org/packages/e7/17/21cc1d0117e26317e4b81306450f92da4699f3e6fc5b6db384aee5dc457b/collective.profiler-0.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0f219fca8e9724607aa6e8b48a6167cc", "sha256": "a85f6f9b23e3b8ca28736335b82575cc862bd1180733b98cb1fd1de8615e2917" }, "downloads": -1, "filename": "collective.profiler-0.3.zip", "has_sig": false, "md5_digest": "0f219fca8e9724607aa6e8b48a6167cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14701, "upload_time": "2011-05-12T14:27:34", "url": "https://files.pythonhosted.org/packages/e7/17/21cc1d0117e26317e4b81306450f92da4699f3e6fc5b6db384aee5dc457b/collective.profiler-0.3.zip" } ] }