{ "info": { "author": "Thomas Guettler", "author_email": "info.live-trace@thomas-guettler.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": ".. image:: https://travis-ci.org/guettli/live-trace.svg?branch=master\n :target: https://travis-ci.org/guettli/live-trace\n \n \nlive-trace\n==========\n\nlive-trace is a Python library to log stacktraces of a running application in a\ndaemon thread N times per second. The log file can be analyzed to see\nwhere the interpreter spends most of the time. It is called\n\"live-trace\" since it can be used on production systems without\nnoticeable performance impact.\n\nAlternatives\n============\n\nlive-trace is a very simple script. I guess (never used it), this is a far better solution: https://github.com/uber/pyflame\n\nOr this one: https://github.com/benfred/py-spy\n\n\nWhy?\n====\n\nIf you want to see why a particular request is slow, then use a profiler, not live-trace.\n\nUse live-trace if you want to see the bird's-eye view. If you ask yourself the question:\n\n What is the interpreter doing all day long?\n\nThen use live-trace in your production environment. Let it collect a lot of snaphosts of the interpreter state.\nThe current implementation uses stacktraces for freezing the state of the interpreter. \nAfter running for some hours you can aggregate the collected stacktraces\nand identify hot spots.\n\n\nUsage\n=====\n\nUsage run-and-analyze::\n\n you@unix> live-trace run-and-analyze your-python-script.py\n\nUsage run, analyze later::\n\n you@unix> live-trace run your-python-script.py\n\n The collected stacktraces will be written to $TMP/live_trace/YYYY-MM-DD....log\n\n Now you can analyze the collected stacktraces:\n\n you@unix> live-trace analyze tmp/live_trace/2017-01-09-11-23-40.log\n\nDevelopment\n===========\n\n# Installing for development\npip install -e git+https://github.com/guettli/live-trace.git#egg=live-trace\n\n# Running tests\ncd src/live-trace\npython setup.py test\n\nDjango Middleware\n=================\n\nThe django middleware is optional. The tool live-trace is a general python tool.\nIf you want to use live-trace in other web frameworks, take this as template.\n\nYou can start the watching thread your django middleware like this::\n\n MIDDLEWARE_CLASSES=[\n ...\n 'live_trace.django_middleware.LiveTraceMiddleware',\n ]\n\nOptional, update the `settings.py`::\n\n live_trace_interval=0.1 # Default is every 0.3 second. Set to None to disable live-tracing.\n\nExample\n=======\n\nThe tool does some guessing which code is from you, and which code is from Python or Django.\n\nSince Python and Django code is already optimized, your code gets highlighted with \"<====\".\n\nThat's most likely your code and this could be a bottle neck::\n\n 1971 File: \"/home/foo_bar_p/django/core/handlers/wsgi.py\", line 272, in __call__\n response = self.get_response(request)\n 1812 File: \"/home/foo_bar_p/django/core/handlers/base.py\", line 111, in get_response\n response = callback(request, *callback_args, **callback_kwargs)\n 1725 File: \"/home/foo_bar_p/django/db/backends/postgresql_psycopg2/base.py\", line 44, in execute\n return self.cursor.execute(query, args)\n 1724 File: \"/home/foo_bar_p/django/db/models/sql/compiler.py\", line 735, in execute_sql\n cursor.execute(sql, params)\n 1007 File: \"/home/foo_bar_p/django/db/models/sql/compiler.py\", line 680, in results_iter\n for rows in self.execute_sql(MULTI):\n 796 File: \"/home/foo_bar_p/django/db/models/query.py\", line 273, in iterator\n for row in compiler.results_iter():\n 763 File: \"/home/foo_bar_p/foo/utils/ticketutils.py\", line 135, in __init__ <====\n filter=type_filter(root_node=self.root_node)\n 684 File: \"/home/foo_bar_p/django/db/models/query.py\", line 334, in count\n return self.query.get_count(using=self.db)\n 679 File: \"/home/foo_bar_p/django/db/models/sql/query.py\", line 367, in get_aggregation\n result = query.get_compiler(using).execute_sql(SINGLE)\n 677 File: \"/home/foo_bar_p/django/db/models/sql/query.py\", line 401, in get_count\n number = obj.get_aggregation(using=using)[None]", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/guettli/live-trace/", "keywords": "", "license": "Apache Software License 2.0", "maintainer": "", "maintainer_email": "", "name": "live-trace", "package_url": "https://pypi.org/project/live-trace/", "platform": "", "project_url": "https://pypi.org/project/live-trace/", "project_urls": { "Homepage": "https://github.com/guettli/live-trace/" }, "release_url": "https://pypi.org/project/live-trace/2017.21.0/", "requires_dist": null, "requires_python": "", "summary": "Trace a Python application using a deamon thread.", "version": "2017.21.0" }, "last_serial": 5112249, "releases": { "2017.11.0": [ { "comment_text": "", "digests": { "md5": "04e5f4cfdc1d1cf65a6a3b20f55062ee", "sha256": "0ccc4d5267763690f11f6f2fdecb4846c161df6a7efcc5f49bc46eece51876d0" }, "downloads": -1, "filename": "live-trace-2017.11.0.tar.gz", "has_sig": false, "md5_digest": "04e5f4cfdc1d1cf65a6a3b20f55062ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7511, "upload_time": "2017-07-26T14:50:58", "url": "https://files.pythonhosted.org/packages/be/aa/ea171c0fd6fd8557dc41de7eb378248719e939ecfccabf7d0ec13e93914a/live-trace-2017.11.0.tar.gz" } ], "2017.13.0": [ { "comment_text": "", "digests": { "md5": "0718c72b5e36bf031c1cb69a48da5946", "sha256": "ee0bde4e2b8fc68d532417261de4f458f538486c4f86bd77c15c4e197a41c2d4" }, "downloads": -1, "filename": "live-trace-2017.13.0.tar.gz", "has_sig": false, "md5_digest": "0718c72b5e36bf031c1cb69a48da5946", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7497, "upload_time": "2017-07-26T14:58:50", "url": "https://files.pythonhosted.org/packages/65/08/99bd98ff46f4b3bc9de65f9fa0445d7828517be4694e4357346ef5d190bd/live-trace-2017.13.0.tar.gz" } ], "2017.14.0": [ { "comment_text": "", "digests": { "md5": "85e233829ec14d5be89bf7cd9cae027c", "sha256": "267650567a0ca6db952ea6d01b9603d18f33359afe965714dd3c1f4341059c2e" }, "downloads": -1, "filename": "live-trace-2017.14.0.tar.gz", "has_sig": false, "md5_digest": "85e233829ec14d5be89bf7cd9cae027c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7513, "upload_time": "2017-07-27T13:30:44", "url": "https://files.pythonhosted.org/packages/3f/cd/750f322db79526221282e029ab932e07a13bd86e466ff4bf35d6e4a4e458/live-trace-2017.14.0.tar.gz" } ], "2017.15.0": [ { "comment_text": "", "digests": { "md5": "4dc0075523c88b429291b33455a1f51e", "sha256": "feccc7ecc017ab6ef953c36585b03334093fbf10b6312424d36f6d59803c7233" }, "downloads": -1, "filename": "live-trace-2017.15.0.tar.gz", "has_sig": false, "md5_digest": "4dc0075523c88b429291b33455a1f51e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7456, "upload_time": "2017-07-28T13:36:41", "url": "https://files.pythonhosted.org/packages/41/b9/8a5b9e7bf32c310b68ed5a232f98d9533d9860ffd9d330fdb83a473f9821/live-trace-2017.15.0.tar.gz" } ], "2017.16.0": [ { "comment_text": "", "digests": { "md5": "1129a7a899d3b40a5881fa082f1d8aaf", "sha256": "7ecfbbb590540f095f922affbc5c3cc9272688d5ca00a3666ab071815fcdd03d" }, "downloads": -1, "filename": "live-trace-2017.16.0.tar.gz", "has_sig": false, "md5_digest": "1129a7a899d3b40a5881fa082f1d8aaf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7453, "upload_time": "2017-07-31T13:38:17", "url": "https://files.pythonhosted.org/packages/e0/ec/206de64480001f868bb631189cfc49ba3b227d7d5fd566b3228cf1397a74/live-trace-2017.16.0.tar.gz" } ], "2017.17.0": [ { "comment_text": "", "digests": { "md5": "b3bcecf3c02d883e8cd56a3b6017ec05", "sha256": "2db6a98581792631a417d500d37c67e29e8768d6d5c3ecb5c5346ca6410c56ea" }, "downloads": -1, "filename": "live-trace-2017.17.0.tar.gz", "has_sig": false, "md5_digest": "b3bcecf3c02d883e8cd56a3b6017ec05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7495, "upload_time": "2017-07-31T13:50:33", "url": "https://files.pythonhosted.org/packages/58/91/20e7820eeec7a092c92f482c40efed1b963d141cf41ba7c8b46598e8b35c/live-trace-2017.17.0.tar.gz" } ], "2017.18.0": [ { "comment_text": "", "digests": { "md5": "967630d2d29cfb2cf8e75f137dbe6ad2", "sha256": "ca410d5fa8a3f5cd67ac109ab50cefa20d9e86c854a73a13d2dfd8c3c395b32e" }, "downloads": -1, "filename": "live-trace-2017.18.0.tar.gz", "has_sig": false, "md5_digest": "967630d2d29cfb2cf8e75f137dbe6ad2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7774, "upload_time": "2017-08-02T08:42:56", "url": "https://files.pythonhosted.org/packages/29/ea/24969aee800048494cc0e30cae198ae0a7fadc521386a6d4f63681418941/live-trace-2017.18.0.tar.gz" } ], "2017.20.0": [ { "comment_text": "", "digests": { "md5": "87a48fc759383b54994520da41109eba", "sha256": "b739a71dd835c53021dd4292b367d5d1bb665671d0544e6746f52e987c87a3e2" }, "downloads": -1, "filename": "live-trace-2017.20.0.tar.gz", "has_sig": false, "md5_digest": "87a48fc759383b54994520da41109eba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7966, "upload_time": "2019-01-10T13:05:59", "url": "https://files.pythonhosted.org/packages/31/88/298dfb0101350b5950c411173448c1fd2c68eb3da9c9dd0ad5e052812a49/live-trace-2017.20.0.tar.gz" } ], "2017.21.0": [ { "comment_text": "", "digests": { "md5": "93de5721674851f5e6cf83f5d6e0169f", "sha256": "5378f2c2accd2abd9c45018f3af38f936cb848ae39355a3cb58aa83016bd2276" }, "downloads": -1, "filename": "live-trace-2017.21.0.tar.gz", "has_sig": false, "md5_digest": "93de5721674851f5e6cf83f5d6e0169f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7995, "upload_time": "2019-04-08T06:59:58", "url": "https://files.pythonhosted.org/packages/cc/b1/3a6b856b88cc7784859d914ff8612b1bf50850fee5a8e684844300d43f3a/live-trace-2017.21.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93de5721674851f5e6cf83f5d6e0169f", "sha256": "5378f2c2accd2abd9c45018f3af38f936cb848ae39355a3cb58aa83016bd2276" }, "downloads": -1, "filename": "live-trace-2017.21.0.tar.gz", "has_sig": false, "md5_digest": "93de5721674851f5e6cf83f5d6e0169f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7995, "upload_time": "2019-04-08T06:59:58", "url": "https://files.pythonhosted.org/packages/cc/b1/3a6b856b88cc7784859d914ff8612b1bf50850fee5a8e684844300d43f3a/live-trace-2017.21.0.tar.gz" } ] }