{ "info": { "author": "Matthew Betts, Aidan Houlihan", "author_email": "aidan@publons.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=================\nFlame analyzer\n=================\n\n.. image:: https://travis-ci.com/publons/flame-analyzer.svg?branch=master\n :target: https://travis-ci.com/publons/flame-analyzer\n\nThis package is an often used part of our debug environment at Publons.\nIt helps benchmark and explain inefficiencies in pieces of code as well as\nour dependencies on different service response times.\n\n\nThere are four kinds of Context managers we support with this package\n\n- FileFlame\n- InlineFlame\n- DjangoFileFlame\n- DjangoInlineFlame\n\nThey all serve the same use case outputting a Flame graph to your machine for\nyou to dive into and debug your code. `FileFlame`/`DjangoFileFlame` save the\ngraph to an SVG for you to share, while `InlineFlame`/`DjangoInlineFlame` will\nrender it in your IPython browser.\n\nExamples\n--------\n\nSaving a Flame graph to an SVG can be done with the following benchmarking\n\n.. code-block:: python\n\n from flame_analyzer import FileFlame\n\n\n with FileFlame('./file_flame_test.svg'):\n # Some expensive piece of code.\n [len(u.email) for u in User.objects.all()]\n\nOr directly to the IPython notebook\n\n.. code-block:: python\n\n from flame_analyzer import InlineFlame\n\n\n with InlineFlame():\n # Some expensive piece of code.\n [len(u.email) for u in User.objects.all()]\n\nYou can also optionally configure the width by adding the width kwarg\n\n.. code-block:: python\n\n with FileFlame(\n './file_flame_test.svg', flame_width=1200,\n options={'title': 'This is my test title'}\n ):\n # some expensive piece of code\n [len(u.email) for u in User.objects.all()]\n\n\nExtensions\n----------\n\nBy default both IPython and Django are optional imports meaning you can install\nthis library and use it in the terminal to debug your app code without them\ninstalled. Support can be added for other Database frameworks or if your\nwanting to hook into the context enter/exit methods by creating your own hooks\nand adding to the output flame type your wanting for example\n\n.. code-block:: python\n\n from flame_analyzer import InlineFlame\n\n class CustomHook:\n \"\"\"\n Append the time taken to execute to the flame graphs title.\n \"\"\"\n def before(self):\n self.called_before = '< Called before code execution >'\n\n def after(self):\n self.called_after = '< Called after code execution >'\n\n def modify_flame_options(self, flame_options):\n title = flame_options.get('title', '')\n flame_options['title'] = self.called_before + ' --- ' + self.called_after\n return flame_options\n\n\n class CustomInlineFlame(InlineFlame):\n hook_classes = (CustomHook,)\n\n with CustomInlineFlame(flame_width=500):\n total_email_length = 0\n for u in User.objects.all():\n total_email_length += len(u.email)\n print(total_email_length)\n\n\nOutputs the IPython viewed Graph\n\n.. image:: https://user-images.githubusercontent.com/6813352/68050764-c1107800-fd4a-11e9-94a2-8ab0bc564617.png\n\nCredits to the following projects:\n - https://github.com/brendangregg/FlameGraph\n - https://github.com/23andMe/djdt-flamegraph\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/publons/flame-analyzer", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "flame-analyzer", "package_url": "https://pypi.org/project/flame-analyzer/", "platform": "", "project_url": "https://pypi.org/project/flame-analyzer/", "project_urls": { "Homepage": "https://github.com/publons/flame-analyzer" }, "release_url": "https://pypi.org/project/flame-analyzer/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "A small Django and IPython compatible application for benchmarking database and IO heavy work.", "version": "0.1.5", "yanked": false, "yanked_reason": null }, "last_serial": 6204322, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d7df2d0ca87195ade14b47ecc6e4fca6", "sha256": "6b2197b0827d54fa5c482bade95577ee16248910ea4fd3be0d18e0b0cd37d2d2" }, "downloads": -1, "filename": "flame_analyzer-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d7df2d0ca87195ade14b47ecc6e4fca6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18273, "upload_time": "2019-10-28T00:47:03", "upload_time_iso_8601": "2019-10-28T00:47:03.676859Z", "url": "https://files.pythonhosted.org/packages/75/b1/230289c0871b8d2f7ba41d654374fdb87eb762de71e6e1df1c5bff607193/flame_analyzer-0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6890150c0250d61a301c5c51943731ee", "sha256": "d85300aaa57a83b9879df12b41e0ff367c38c1b07e1253cf759b523192454306" }, "downloads": -1, "filename": "flame_analyzer-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6890150c0250d61a301c5c51943731ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18299, "upload_time": "2019-11-01T19:54:32", "upload_time_iso_8601": "2019-11-01T19:54:32.364616Z", "url": "https://files.pythonhosted.org/packages/eb/df/3fbb12cda074b8a1ab2b14e438f1d61c4e0fdc7f7b12142662382be23c5c/flame_analyzer-0.1.1-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "fed1cac6e13840b2715d19b1c72efad5", "sha256": "9cf3370ba10ce5fc57dbf55dd83610b977e1e66f655aa877d66fc78293ab7f57" }, "downloads": -1, "filename": "flame_analyzer-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "fed1cac6e13840b2715d19b1c72efad5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19420, "upload_time": "2019-11-01T19:57:22", "upload_time_iso_8601": "2019-11-01T19:57:22.440335Z", "url": "https://files.pythonhosted.org/packages/de/38/e7666e108cd930f9538789c70efe61798d3df1fbc289fcb9941b10413328/flame_analyzer-0.1.2-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "02bed6be7dc929f54b83183b33b99c93", "sha256": "1af18fc70028e8b14fbc620b68eacd59bbcd2a12daed29c71308f3db2e4ddcf9" }, "downloads": -1, "filename": "flame_analyzer-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "02bed6be7dc929f54b83183b33b99c93", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19457, "upload_time": "2019-11-01T20:04:10", "upload_time_iso_8601": "2019-11-01T20:04:10.052919Z", "url": "https://files.pythonhosted.org/packages/f6/c1/3245051320ad459196f2290d118435456451a03e8b5ddb9e105e5bd0bfc9/flame_analyzer-0.1.3-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f95679a2e043c620c1727e1701a8f2f6", "sha256": "24a826e401ac54d6cc0472b474a96da043cab5de1ec1232136fc6c1f5ee776a8" }, "downloads": -1, "filename": "flame_analyzer-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "f95679a2e043c620c1727e1701a8f2f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19475, "upload_time": "2019-11-04T22:35:34", "upload_time_iso_8601": "2019-11-04T22:35:34.075361Z", "url": "https://files.pythonhosted.org/packages/65/86/4717982e35027364ed14799186ac451b4f54b5dd67c54a19fcb9b78af95f/flame_analyzer-0.1.4-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "9f4e5ca44a978bd370a2ba5c7b69ab68", "sha256": "2a5707b124cd6ecc05f2a898feb655405e86bd0e535b14c0ed5dd45fe7cbbdb4" }, "downloads": -1, "filename": "flame-analyzer-0.1.4.tar.gz", "has_sig": false, "md5_digest": "9f4e5ca44a978bd370a2ba5c7b69ab68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6132, "upload_time": "2019-11-04T22:35:36", "upload_time_iso_8601": "2019-11-04T22:35:36.041685Z", "url": "https://files.pythonhosted.org/packages/9a/38/0d5fa14d43a2b3684b2c4f7542c7d2066a22fe83eee23f4e25ea25763377/flame-analyzer-0.1.4.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "54db7a4d361ae10d8df592bb29df0e4e", "sha256": "ade02ab912d13ce8390b12ff217f0fa37a6632b4de3c35e250ff9a77d70560e4" }, "downloads": -1, "filename": "flame_analyzer-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "54db7a4d361ae10d8df592bb29df0e4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19478, "upload_time": "2019-11-26T22:50:51", "upload_time_iso_8601": "2019-11-26T22:50:51.438678Z", "url": "https://files.pythonhosted.org/packages/29/20/2044c9abe18f012aca99d60560d5ca2c87d8fa68e0ceca42408865ef30d5/flame_analyzer-0.1.5-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "6601f5c0fdf3932ff43c182277f5e101", "sha256": "5e6761662252762fc8b702a30fbfb32f83dc46dc74716da579908ed027770b94" }, "downloads": -1, "filename": "flame-analyzer-0.1.5.tar.gz", "has_sig": false, "md5_digest": "6601f5c0fdf3932ff43c182277f5e101", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5863, "upload_time": "2019-11-26T22:50:53", "upload_time_iso_8601": "2019-11-26T22:50:53.596792Z", "url": "https://files.pythonhosted.org/packages/7d/d9/6a913058b6232602b1a256a145f6959dae027cfdb9cb711c6d26b979a3a8/flame-analyzer-0.1.5.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "54db7a4d361ae10d8df592bb29df0e4e", "sha256": "ade02ab912d13ce8390b12ff217f0fa37a6632b4de3c35e250ff9a77d70560e4" }, "downloads": -1, "filename": "flame_analyzer-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "54db7a4d361ae10d8df592bb29df0e4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19478, "upload_time": "2019-11-26T22:50:51", "upload_time_iso_8601": "2019-11-26T22:50:51.438678Z", "url": "https://files.pythonhosted.org/packages/29/20/2044c9abe18f012aca99d60560d5ca2c87d8fa68e0ceca42408865ef30d5/flame_analyzer-0.1.5-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "6601f5c0fdf3932ff43c182277f5e101", "sha256": "5e6761662252762fc8b702a30fbfb32f83dc46dc74716da579908ed027770b94" }, "downloads": -1, "filename": "flame-analyzer-0.1.5.tar.gz", "has_sig": false, "md5_digest": "6601f5c0fdf3932ff43c182277f5e101", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5863, "upload_time": "2019-11-26T22:50:53", "upload_time_iso_8601": "2019-11-26T22:50:53.596792Z", "url": "https://files.pythonhosted.org/packages/7d/d9/6a913058b6232602b1a256a145f6959dae027cfdb9cb711c6d26b979a3a8/flame-analyzer-0.1.5.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }