{ "info": { "author": "Perminder Singh", "author_email": "svicky9797@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2.7" ], "description": "# HTTP Server-Timing for Python Flask\n\n\nThis is a library including middleware for using\n[HTTP Server-Timing](https://www.w3.org/TR/server-timing) with Python. This header\nallows a server to send timing information from the backend, such as database\naccess time, file reads, etc. The timing information can be then be inspected\nin the standard browser developer tools:\n\n![Server Timing Example](https://github.com/PammyS/server-timing-profiler/blob/master/example/ScreenShot.png)\n\n## Features\n\n * Middleware for injecting the server timing into the request `Context`\n and writing the `Server-Timing` header.\n\n * Concurrency-safe structures for easily recording timings of multiple\n concurrency tasks.\n\n * Parse `Server-Timing` headers as a client.\n\n * Note: No browser properly supports sending the Server-Timing header as\n an [HTTP Trailer](https://tools.ietf.org/html/rfc7230#section-4.4) so\n\tthe Middleware only supports a normal header currently.\n\n## Browser Support\n\nBrowser support is required to **view** server timings easily. Because server\ntimings are sent as an HTTP header, there is no negative impact to sending\nthe header to unsupported browsers.\n\n * **Chrome 65 or higher** is required to properly display server timings\n in the devtools.\n\n## Usage\n\nExample usage is shown below. A fully runnable example is available in\nthe `example/` directory.\n\n```python\nfrom flask import Flask, jsonify\nimport time\nfrom profiler.profile_manager import ProfileManager\n\napp = Flask(__name__)\n\nprofiler = ProfileManager(app, 'debug')\n\n\n@app.route(\"/test\", methods=[\"GET\"])\ndef hello():\n print 'test start sleep'\n\n profiler.start('App 1')\n time.sleep(1)\n profiler.stop('App 1')\n\n profiler.start('App 2')\n time.sleep(2)\n profiler.stop('App 2')\n\n profiler.start('App 3')\n time.sleep(3)\n profiler.stop('App 3')\n\n profiler.start('App 4')\n time.sleep(4)\n profiler.stop('App 4')\n\n print 'test stop sleep'\n return jsonify({'success':True})\n\napp.run(host=\"0.0.0.0\",port=8080,debug=True)\n```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PammyS/server-timing-profiler", "keywords": "HTTP Server-Timing for Python Flask", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "server-timing-profiler", "package_url": "https://pypi.org/project/server-timing-profiler/", "platform": "Linux", "project_url": "https://pypi.org/project/server-timing-profiler/", "project_urls": { "Homepage": "https://github.com/PammyS/server-timing-profiler" }, "release_url": "https://pypi.org/project/server-timing-profiler/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "HTTP Server-Timing for Python Flask", "version": "0.0.2" }, "last_serial": 3760928, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "2fcb524bd004d9fbae38e96d18a438ed", "sha256": "dcbafba5d7eb71662b71e2a24679662be9e493691b707d2a902e2a0026e6206d" }, "downloads": -1, "filename": "server-timing-profiler-0.0.2.tar.gz", "has_sig": false, "md5_digest": "2fcb524bd004d9fbae38e96d18a438ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3060, "upload_time": "2018-04-13T07:26:25", "url": "https://files.pythonhosted.org/packages/7b/c0/f4b212cb3a29f30f15aba5639b8291d3c0ecb915824cd26bc73517b15192/server-timing-profiler-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2fcb524bd004d9fbae38e96d18a438ed", "sha256": "dcbafba5d7eb71662b71e2a24679662be9e493691b707d2a902e2a0026e6206d" }, "downloads": -1, "filename": "server-timing-profiler-0.0.2.tar.gz", "has_sig": false, "md5_digest": "2fcb524bd004d9fbae38e96d18a438ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3060, "upload_time": "2018-04-13T07:26:25", "url": "https://files.pythonhosted.org/packages/7b/c0/f4b212cb3a29f30f15aba5639b8291d3c0ecb915824cd26bc73517b15192/server-timing-profiler-0.0.2.tar.gz" } ] }