{ "info": { "author": "Piotr Szymanski", "author_email": "piotr.szymanski@fieldaware.com", "bugtrack_url": null, "classifiers": [], "description": "[![CircleCI](https://circleci.com/gh/fieldaware/liveprofiler.svg?style=svg)](https://circleci.com/gh/fieldaware/liveprofiler)\n[![PyPI version](https://badge.fury.io/py/liveprofiler.svg)](https://badge.fury.io/py/liveprofiler)\n\n# Liveprofiler visualizer and collector\n\nThis is a service that collects and presents samples generated by [livepofier_sampler](https://github.com/fieldaware/liveprofiler_sampler).\nIt is follow up work based on https://github.com/nylas/nylas-perftools. So most of the credit goes to: nylas.com\n\nTo really understand what is going on here check this great blog post: https://www.nylas.com/blog/performance\n\n# Overview\n\n```\n web client\nservice one<----------------+ +\n | |\n + v\nservice two<-----------+collector+--------+ visualizer\n + | ^\n | v |\nservice three<--------------+ database+--------+\n\n```\n\n* each service runs liveprofiler_sampler middleware\n* collector pulls metrics from services and saves them to python dbm database\n* visualizer reads dbm database and plots the results per host\n\n# Collector\n\nCollector is responsible for gathering samples for configured hosts. Because sampler is protected with secret header, it has to be configured in collector as well. Collector should be called periodically (every few seconds). If you are planning to run collector with uWSGI (recommended) see running with uWSGI section. If not, you can set up cron to call `collector/` endpoint. It will return number of collected samples from all hosts.\n\n```\n[collector]\nsecret_header = {SECRET HEADER}\nhosts= {LIST OF HOSTS SEPARATED BY COMMA (host1,host2,host3)}\n```\n\n# Visualizer\n\nUses flame graph to plot stacks and their counts.\n\n![visualized samples](visualizer.png \"Example visualization\")\n\n# Example\n\nIf you provide sampler configuration you can plot samples for the visualizer itself - it is a nice self-contained demo.\n\nThis is a snippet from the `example/config.ini`\n```\n[global]\ndbpath = /tmp/liveprofiler/\n\n[collector]\nsecret_header = samplers3cr3t\nhosts=localhost:9999\n\n[sampler]\nenabled = 1\ninterval = 0.01\nsecret_header = samplers3cr3t\n```\n\n* `secret_header` is the same on the both sides.\n* If sampler configuration is not provided or if the sampler is not enabled no metrics will be collected\n\nTo run the example, create virtualenv and install dependencies from requirements.txt (`pip install -r requirements.txt`)\n\nTo run the server:\n\n```\n> uwsgi example/uwsgi.ini\n```\n\nThen visit `http://localhost:9999/`.\n\n# uWSGI integration\n\n* Use at least 2 workers (processes) to run visualizer - one for visualizer and one for collector\n* Visualizer uses [uWSGI decorators](http://uwsgi-docs.readthedocs.io/en/latest/PythonDecorators.html) to schedule collector calls - therefore `master = true` has to be enabled in uWSGI configuration\n* `app_config` is a path to the visualizer configuration file - it must be set and it recommend it be an absolute path\n* if you are running visualizer with sampler enabled please check required uWSGI configuration to make it running", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fieldaware/liveprofiler", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "liveprofiler", "package_url": "https://pypi.org/project/liveprofiler/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/liveprofiler/", "project_urls": { "Homepage": "https://github.com/fieldaware/liveprofiler" }, "release_url": "https://pypi.org/project/liveprofiler/1.0.0/", "requires_dist": [ "click (==6.6)", "dateparser (==0.3.5)", "flask (>=0.10.1)", "liveprofiler-sampler (==0.9.2)", "requests (>=2.4.3)", "uWSGI (==2.0.13.1)" ], "requires_python": "", "summary": "Package for profiling WSGI applications on production", "version": "1.0.0" }, "last_serial": 2201679, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "11018c3f788b3e7cf0ad4e46a0f97fe3", "sha256": "2be1fc451ece0367aceeadda870d4a69acd488779dd89e0ed4d1fdb7a25a7b0a" }, "downloads": -1, "filename": "liveprofiler-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11018c3f788b3e7cf0ad4e46a0f97fe3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 91522, "upload_time": "2016-06-27T16:30:16", "url": "https://files.pythonhosted.org/packages/78/ca/53d869a1d58906253be362fd069a786a50bd1fbcb0576b979d6ba276c7db/liveprofiler-0.2.0-py2.py3-none-any.whl" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "d9aa4266f75ef0cff633993aef259f0a", "sha256": "9828f2e1bcd3a143e74a7e2fe9928fc7a32ed5071c0a855623603c426d076272" }, "downloads": -1, "filename": "liveprofiler-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d9aa4266f75ef0cff633993aef259f0a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 94381, "upload_time": "2016-07-04T12:36:52", "url": "https://files.pythonhosted.org/packages/a8/20/542da326c0febce1060a44c73db1a324fb49f8d2a5f5b0ee79914a4b955c/liveprofiler-1.0.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d9aa4266f75ef0cff633993aef259f0a", "sha256": "9828f2e1bcd3a143e74a7e2fe9928fc7a32ed5071c0a855623603c426d076272" }, "downloads": -1, "filename": "liveprofiler-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d9aa4266f75ef0cff633993aef259f0a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 94381, "upload_time": "2016-07-04T12:36:52", "url": "https://files.pythonhosted.org/packages/a8/20/542da326c0febce1060a44c73db1a324fb49f8d2a5f5b0ee79914a4b955c/liveprofiler-1.0.0-py2.py3-none-any.whl" } ] }