{ "info": { "author": "Jesse Buesking", "author_email": "jessebuesking+pypi@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Clocked\n=======\n\nA library to enable easier profiling, based _**loosely**_ on\n[MiniProfiler](http://miniprofiler.com/). For a more full-featured\nimplementation for use in web development, check out the [GAE Mini Profiler]\n(https://github.com/Khan/gae_mini_profiler). This library is meant to be more\nlightweight than a full MiniProfiler implementation so that you can quickly\nload it into a project and start timing things.\n\nUse Case\n========\nI was looking to profile some code and came across [this blog post]\n(http://www.huyng.com/posts/python-performance-analysis/) that covers things\nquite nicely. However, the coarse and fine grain timing sections leaves a lot\nup to reader and aren't very robust, so this library is meant to fill the gap.\n\nThis library is meant to be used to do higher-level profiling,\nwhere you litter your code with profiling statements and generate a report to\nquickly find where your code is spending all of it's time. From there,\nfall back to tools like [timeit](https://docs.python.org/2/library/timeit\n.html) or [line_profiler](https://github.com/rkern/line_profiler).\n\nTo start, initialize the session by calling\n\n```python\nClocked.initialize('at the root scope!')\n```\n\nThen run your code with ``clocked`` decorators and/or ``with Clocked``\nstatements. At the end of the session, output a report with either\n``Clocked.verbose_report()`` or ``Clocked.hotspot_report()`` to see some\ntiming information.\n\nSupported ways to decorate\n--------------------------\n\n#### class level\n\n```python\n@clocked\nclass MyClass(object):\n\n def will_be_timed_one(self):\n ...\n\n def will_be_timed_two(self):\n ...\n\n```\n\n#### function level\n\n```python\nclass MyClass(object):\n\n @clocked\n def will_be_timed(self):\n ...\n\n def will_not_be_timed(self):\n ...\n\n```\n\nDecorators aren't specific to classes, so you can apply them to individual\nfunctions like so\n\n```python\n@clocked\ndef some_function():\n ...\n```\n\nHow to use inline\n-----------------\n\nYou can use the Clocked object to time something without using a decorator\n\n```python\nwith Clocked(\"i'm timing this!\"):\n ...\n```\n\nGenerate a report\n-----------------\n\nTo get at the timing information, the simplest thing to do is generate a report\n\n```python\n>>> Clocked.verbose_report()\n\"\"\"\nAll timing information:\n-----------------------\ntest raw simple (326.5 ms)\n loop 1 (326.5 ms)\n\"\"\"\n>>> Clocked.hotspot_report()\n\"\"\"\nHotspots:\n---------\nloop 4 (164.5 ms [19.9, 22.0], 8 hits)\nloop 3 (160.8 ms [19.9, 20.9], 8 hits)\nloop 2 (1.0 ms [0.2, 0.3], 4 hits)\nloop 1 (0.2 ms [0.2, 0.2], 1 hits)\ntest raw simple (0.0 ms [0.0, 0.0], 1 hits)\n\"\"\"\n```\n\nPerformance\n-----------\n\nTo improve performance when testing single-threaded applications,\nenable faster uuid generation by turning on thread unsafe uuid generation with\n``clocked.cuuid.toggle_thread_unsafe_uuid(True)``", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/JesseBuesking/clocked/tarball/0.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JesseBuesking/clocked", "keywords": "benchmark,benchmarking,profiler,profiling", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "clocked", "package_url": "https://pypi.org/project/clocked/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/clocked/", "project_urls": { "Download": "https://github.com/JesseBuesking/clocked/tarball/0.2", "Homepage": "https://github.com/JesseBuesking/clocked" }, "release_url": "https://pypi.org/project/clocked/0.62/", "requires_dist": null, "requires_python": null, "summary": "python library for high level profiling", "version": "0.62" }, "last_serial": 1308774, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "4780a5049509879786bf86c05c01af1b", "sha256": "6fea2140cc63ab412300145e79d6522bdbf7d389900a2513f83d3978bc9912f9" }, "downloads": -1, "filename": "clocked-0.1.zip", "has_sig": false, "md5_digest": "4780a5049509879786bf86c05c01af1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10969, "upload_time": "2014-11-15T22:18:42", "url": "https://files.pythonhosted.org/packages/ce/d3/e5289ea0df1dc50c1d4ade3de56412e8893890a372b5328a4ea5aa95db53/clocked-0.1.zip" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "093a7a58d9a9b128d43c4b717c87537b", "sha256": "b135f5fd5afafaf60e409dacb7bc8c9fe3f7d8e977af09f7c421b9757f36bd82" }, "downloads": -1, "filename": "clocked-0.2.zip", "has_sig": false, "md5_digest": "093a7a58d9a9b128d43c4b717c87537b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11013, "upload_time": "2014-11-15T22:30:23", "url": "https://files.pythonhosted.org/packages/68/03/066e99bbfa6842d9de921ac8410e491f4d12be5713a3957f84ce1a53dd29/clocked-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "8426f11fbe2503e6e94aaaee9d650b12", "sha256": "a7389bde2217063cdf3fb4b4a35eb0bab91d2dc777b2453c5396a686d1def09e" }, "downloads": -1, "filename": "clocked-0.3.zip", "has_sig": false, "md5_digest": "8426f11fbe2503e6e94aaaee9d650b12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11042, "upload_time": "2014-11-15T23:56:19", "url": "https://files.pythonhosted.org/packages/1c/e7/b1eecd9902eb5fd3a9ea5e21b7c5b2afc46ecc95f72ac6abf3e9683bc1df/clocked-0.3.zip" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "5800fef8a0ba7565d700cb8af744e068", "sha256": "e0745cae129a3f97be5748e3a2136be0aab0e3b713b8d815f9f2dc3a7328d221" }, "downloads": -1, "filename": "clocked-0.4.zip", "has_sig": false, "md5_digest": "5800fef8a0ba7565d700cb8af744e068", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11124, "upload_time": "2014-11-16T00:07:44", "url": "https://files.pythonhosted.org/packages/61/00/301a71558a77eea83454d516975e3ef98689b20a191c3a3e3b8cf02188bf/clocked-0.4.zip" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "8c0ac7e26d55a9407362f34fb790f1cb", "sha256": "0e0a9b4dbce5243943517987cb3cb90d83e1e4d3d32329a5131b89c319b49c01" }, "downloads": -1, "filename": "clocked-0.5.zip", "has_sig": false, "md5_digest": "8c0ac7e26d55a9407362f34fb790f1cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11237, "upload_time": "2014-11-16T06:10:57", "url": "https://files.pythonhosted.org/packages/88/ba/745a7fac00a0bae207cdc71ed0aead7aac0f2c67e0618122ca7fb2e67651/clocked-0.5.zip" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "13e65f15185499078ea5bfcff6e5ade2", "sha256": "c258d0a6a486549e798e3832be32493a4c45c97a06c28f9e9fecacc4c3d44ee3" }, "downloads": -1, "filename": "clocked-0.6.zip", "has_sig": false, "md5_digest": "13e65f15185499078ea5bfcff6e5ade2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11948, "upload_time": "2014-11-16T08:55:22", "url": "https://files.pythonhosted.org/packages/77/23/2841eb4c98431fab3eb6528f2369e56e2d1905e2951ce587cea3ece7501c/clocked-0.6.zip" } ], "0.61": [ { "comment_text": "", "digests": { "md5": "1614f02ca4baafaa4a0a489be3d1b589", "sha256": "a67e155d8d4c97c00dfce12096434a6cafd20601b207392824f3ce5f5605f454" }, "downloads": -1, "filename": "clocked-0.61.zip", "has_sig": false, "md5_digest": "1614f02ca4baafaa4a0a489be3d1b589", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11979, "upload_time": "2014-11-16T08:57:44", "url": "https://files.pythonhosted.org/packages/f4/22/38de2c0a77319a835901805b77c9a77716e15dcaa50b9779a1a58b1180aa/clocked-0.61.zip" } ], "0.62": [ { "comment_text": "", "digests": { "md5": "1323a60fd2d4c88878b4703d12cc4bf1", "sha256": "57c2f9dd7a6cec676fa2106871aefc595d4f437af8eea66a6616318dd3aea6f2" }, "downloads": -1, "filename": "clocked-0.62.zip", "has_sig": false, "md5_digest": "1323a60fd2d4c88878b4703d12cc4bf1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11938, "upload_time": "2014-11-16T10:03:03", "url": "https://files.pythonhosted.org/packages/5e/90/74111cf44a0e427e713b8bd5fc71b7054df0baa9530b21e09fd21e2948a5/clocked-0.62.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1323a60fd2d4c88878b4703d12cc4bf1", "sha256": "57c2f9dd7a6cec676fa2106871aefc595d4f437af8eea66a6616318dd3aea6f2" }, "downloads": -1, "filename": "clocked-0.62.zip", "has_sig": false, "md5_digest": "1323a60fd2d4c88878b4703d12cc4bf1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11938, "upload_time": "2014-11-16T10:03:03", "url": "https://files.pythonhosted.org/packages/5e/90/74111cf44a0e427e713b8bd5fc71b7054df0baa9530b21e09fd21e2948a5/clocked-0.62.zip" } ] }