{ "info": { "author": "garenchan", "author_email": "1412950785@qq.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "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 :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "# Tornado-Profiler\n\nA profiler measures endpoints defined in your tornado application.\n\n\n## Screenshots\n\n### Dashboard: Give a summary of all datas\n\nIf an endpoint has been accessed before, you can see its summary data as follows.\n\n![dashboard](https://raw.githubusercontent.com/garenchan/tornado-profiler/master/docs/screenshots/dashboard.png)\n\n### Filtering: Give filtered datas \n\nYou can create filters to get datas that meet the criterias.\n\n![filtering](https://raw.githubusercontent.com/garenchan/tornado-profiler/master/docs/screenshots/filtering.png)\n\n### Context: Give all details of a request\n\nYou can get all details of a request as you wish.\n\n![context](https://raw.githubusercontent.com/garenchan/tornado-profiler/master/docs/screenshots/context.png)\n\n\n## Installation\n\nPyPI version:\n\n $ pip install tornado-profiler\n\nDevelopment version:\n\n $ pip install https://github.com/garenchan/tornado-profiler/zipball/master\n\n\n## Quick Start\n\nJust add a few lines to you codes:\n```python\n# demo.py\nimport tornado.ioloop\nimport tornado.web\n\nfrom tornado_profiler import Profiler\n\n\nclass MainHandler(tornado.web.RequestHandler):\n def get(self):\n self.write(\"main\")\n\nclass HelloHandler(tornado.web.RequestHandler):\n def get(self):\n self.write(\"Hello, world\")\n\ndef make_app():\n app = tornado.web.Application([\n (r\"/\", MainHandler),\n ])\n\n # use to store measurement datas\n backend = {\n \"engine\": \"sqlalchemy\",\n }\n # instantiate profiler\n profiler = Profiler(backend)\n # do something to your app\n profiler.init_app(app)\n\n # you can add some rules that won't be profiled here\n app.add_handlers(r\".*\", [\n (r\"/hello\", HelloHandler),\n ])\n\n return app\n\nif __name__ == \"__main__\":\n app = make_app()\n app.listen(8888)\n tornado.ioloop.IOLoop.current().start()\n```\n\nNow run your `demo.py` and make some requests as follows:\n\n $ curl http://127.0.0.1:8888/\n $ curl http://127.0.0.1:8888/hello\n\nIf everything is ok, tornado-profiler will measure these requests. You can see the result heading to http://127.0.0.1:8888/tornado-profiler or get results as JSON http://127.0.0.1:8888/tornado-profiler/api/measurements\n\n\n## Data Storage Backend\n\nYou can use some databases to store your measurement data, such as SQLite, Mysql. The drivers we support are shown as follows:\n\n### SQLAlchemy\n\nIn order to use SQLAlchemy, just specify backend's engine as \"sqlalchemy\". This will use `SQLite` by default and save it to `tornado_profiler.db` in your working directory.\n\n backend = {\n \"engine\": \"sqlalchemy\",\n }\n\nIf your want to change default sqlite database filename or use other databases, you need to set `db_url` manually:\n\n backend = {\n \"engine\": \"sqlalchemy\",\n \"db_url\": \"sqlite:///dbname.db\",\n }\n\n backend = {\n \"engine\": \"sqlalchemy\",\n \"db_url\": \"mysql+://user:password@[:]/\",\n }\n\nSetting some attributes of SQLAlchemy is also necessary, you just need to pass them into the backend dict:\n\n backend = {\n \"engine\": \"sqlalchemy\",\n \"db_url\": \"mysql+://user:password@[:]/\",\n # attributes\n \"pool_recycle\": 3600,\n \"pool_timeout\": 30,\n \"pool_size\": 30,\n \"max_overflow\": 20,\n }\n\nIn some scenarios, we do not want to persist measurement datas, we can use the in-memory database of SQLite and datas will be lost when your web server stops or restarts:\n\n backend = {\n \"engine\": \"sqlalchemy\",\n \"db_url\": \"sqlite://\",\n }\n\n### Other Drivers\n\n**coming soon!**\n\n## Comment\n\nIf you have any other requirements, please submit PR or issues. I will reply to you as soon as possible.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/garenchan/tornado-profiler", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "tornado-profiler", "package_url": "https://pypi.org/project/tornado-profiler/", "platform": "", "project_url": "https://pypi.org/project/tornado-profiler/", "project_urls": { "Homepage": "https://github.com/garenchan/tornado-profiler" }, "release_url": "https://pypi.org/project/tornado-profiler/1.0.0/", "requires_dist": [ "tornado (>=4.5)" ], "requires_python": "", "summary": "A profiler for Tornado Web Server", "version": "1.0.0" }, "last_serial": 4050025, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "222a3e63667b01cb7f6e6330bcb5dcea", "sha256": "59b977563c583ca553b921d88111fac49e534df8a375d5d437dcf2e0af8959ee" }, "downloads": -1, "filename": "tornado_profiler-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "222a3e63667b01cb7f6e6330bcb5dcea", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1241040, "upload_time": "2018-07-11T08:23:27", "url": "https://files.pythonhosted.org/packages/66/8e/9a4b34d81d2fa4cdf01d5b6f3fd96af3c6a0f45b54bd9a3ce5112e980469/tornado_profiler-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c03f4438b9ade3f8a49def3fe4565701", "sha256": "f7ba8422333d0886c070b06a0c5777e237175d20208efb386dc240400ac69392" }, "downloads": -1, "filename": "tornado-profiler-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c03f4438b9ade3f8a49def3fe4565701", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1255682, "upload_time": "2018-07-11T08:24:15", "url": "https://files.pythonhosted.org/packages/b1/53/650b3d4c31213c71afba652d821d562298f8a03a70a8a2522ec9df1d5811/tornado-profiler-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "222a3e63667b01cb7f6e6330bcb5dcea", "sha256": "59b977563c583ca553b921d88111fac49e534df8a375d5d437dcf2e0af8959ee" }, "downloads": -1, "filename": "tornado_profiler-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "222a3e63667b01cb7f6e6330bcb5dcea", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1241040, "upload_time": "2018-07-11T08:23:27", "url": "https://files.pythonhosted.org/packages/66/8e/9a4b34d81d2fa4cdf01d5b6f3fd96af3c6a0f45b54bd9a3ce5112e980469/tornado_profiler-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c03f4438b9ade3f8a49def3fe4565701", "sha256": "f7ba8422333d0886c070b06a0c5777e237175d20208efb386dc240400ac69392" }, "downloads": -1, "filename": "tornado-profiler-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c03f4438b9ade3f8a49def3fe4565701", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1255682, "upload_time": "2018-07-11T08:24:15", "url": "https://files.pythonhosted.org/packages/b1/53/650b3d4c31213c71afba652d821d562298f8a03a70a8a2522ec9df1d5811/tornado-profiler-1.0.0.tar.gz" } ] }