{ "info": { "author": "sloev", "author_email": "johannes.valbjorn@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "[![Latest Version](https://img.shields.io/pypi/v/metrace.svg)](https://pypi.python.org/pypi/metrace) [![Python Support](https://img.shields.io/pypi/pyversions/metrace.svg)](https://pypi.python.org/pypi/metrace)\n\n# Metrace - cpu/memory tracing for process trees\n\nMetrace makes it easy to get a nice interactive html plot of the cpu/memory usage of a whole process tree.\n\n\n\n\n\n\n\n## Install\n\nMetrace depends on `Plotly` and `Psutil`, both will be installed with metrace using pip:\n\n```\n$ pip install metrace\n```\n\n## Client usage (optional)\n\nMetrace lets you annotate specific parts of your code with scopes and these will become part of your final plot output and end up look like this:\n\n\n\n\n\n\n\nMetrace gives you a context manager `trace` you can wrap code blocks with:\n\n```\n$ cat foobar.py\n\nfrom metrace import trace\n\nwith trace('creating 1000 objects'):\n l = []\n for i in range(1000):\n l.append(object())\n```\n\nTo collect these traces you run your script with metrace as usual:\n\n```\n$ metrace run python foobar.py\n```\n\n## Commandline Usage\n\nAfter installation you will have the **metrace** command available.\n\n```\n$ metrace run python main.py && metrace plot\n```\n\n**It has two subcommands:**\n\n### run\n\n```\n$ metrace run python foobar.py\n```\n\nRuns a process and collects cpu/memory metrics for both the process and its children seperately.\n\nMetrace outputs the metrics in a json file in current working directory named like: `metrace_1568385178098218.json` with the number being milliseconds since epoch.\n\n### plot\n\n```\n$ metrace plot\n# or\n# to not open the html report automatically:\n$ metrace plot --autoopen=no\n# or\n# to specify input/output files\n$ metrace plot -i metrace_1568385178098218.json -o metrace_report.html\n```\n\nPlots cpu/memory usage for a given, or latest found, `metrace json file`.\n\nOutput is a html file where you can download the images, zoom in and hover to inspect the different traces.\n\n\n## Samples\n\nDocs folder contains a sample of a [metrace json file](./docs/metrace_1568385178098218.json) and a [metrace html report](./docs/metrace_report.html)\n\n# Attribution\n\n[plotly.min.js](https://github.com/plotly/plotly.js) Licensed under MIT, has been included in this library here: [metrace/plotly_latest.min.js](./metrace/plotly_latest.min.js)", "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/sloev/metrace", "keywords": "metrace cpu memory trace", "license": "", "maintainer": "", "maintainer_email": "", "name": "metrace", "package_url": "https://pypi.org/project/metrace/", "platform": "", "project_url": "https://pypi.org/project/metrace/", "project_urls": { "Homepage": "https://github.com/sloev/metrace" }, "release_url": "https://pypi.org/project/metrace/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "cpu and memory tracing for process trees", "version": "1.0.1" }, "last_serial": 5902317, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "907f90bb4b1b0f179d08c2fde5b10d7e", "sha256": "c4b6b5e63b39edf0faa75da7198d68b4fd213190b45d989e1e941428a3fe2ffa" }, "downloads": -1, "filename": "metrace-0.0.1-py3.7.egg", "has_sig": false, "md5_digest": "907f90bb4b1b0f179d08c2fde5b10d7e", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 16787, "upload_time": "2019-09-17T11:31:59", "url": "https://files.pythonhosted.org/packages/a5/b6/b2d2317eacf9f5c13605ec07947c1e43e3171092742f2f21ae94e796ae70/metrace-0.0.1-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "bd8e2427eccb836843c5de8615ad97a5", "sha256": "c893bab05ab16f2bd55535db99ea4e4ae5dabf1cfeb0135d1aa40949af0b875a" }, "downloads": -1, "filename": "metrace-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bd8e2427eccb836843c5de8615ad97a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 966198, "upload_time": "2019-09-17T11:32:03", "url": "https://files.pythonhosted.org/packages/bd/bc/c45c32b6f829708558d6fd0d6c7f0f886dc8d61b730cec1769b79be6a44c/metrace-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "33d54dc355bf1bca19f0a1572b49a654", "sha256": "3280d4ec5d2fa4f3785c83e073ecd0ce7d80b8ebdcf7d63d62e84493389a9249" }, "downloads": -1, "filename": "metrace-0.0.2.tar.gz", "has_sig": false, "md5_digest": "33d54dc355bf1bca19f0a1572b49a654", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 966222, "upload_time": "2019-09-17T11:40:45", "url": "https://files.pythonhosted.org/packages/99/db/31184080217a3bfa6f76edd3724ef0d444f07fa5d4b2f16fdc9ca7209bf9/metrace-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "96cea29a2889c1ad1aa68d7ae599ec38", "sha256": "d2df3faf9f144c9b21e1a04a771ef992e143647bf6c11da111351237067b968f" }, "downloads": -1, "filename": "metrace-0.0.3.tar.gz", "has_sig": false, "md5_digest": "96cea29a2889c1ad1aa68d7ae599ec38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 966389, "upload_time": "2019-09-17T13:21:08", "url": "https://files.pythonhosted.org/packages/91/42/a4a6d989d9af7656d145b37300d7933f4b926db44da7314a08724d8b5d23/metrace-0.0.3.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "45931671d6108416685a80df048426ff", "sha256": "db4cf75bd14de62ec0f79e38cc995adc3e571668bc6eb7497f33f0a1e30f1c5e" }, "downloads": -1, "filename": "metrace-1.0.0.tar.gz", "has_sig": false, "md5_digest": "45931671d6108416685a80df048426ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 966395, "upload_time": "2019-09-17T13:22:57", "url": "https://files.pythonhosted.org/packages/01/38/c3361c2e9a409eca50bf38f5d45b39ab7a1316f89e87ba249882aa423963/metrace-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e9e4f102c15d1f984a2d395ec7b6739e", "sha256": "be9fe736163a695e5f1bd3fb4ee53a500b65ca427d75615d9c908b27ab7ca6bc" }, "downloads": -1, "filename": "metrace-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e9e4f102c15d1f984a2d395ec7b6739e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 966513, "upload_time": "2019-09-29T10:22:41", "url": "https://files.pythonhosted.org/packages/c0/fc/a1c4b5ba8953e0230af9c093888fb3730ddf3bd97d63840b1cbf58caf8df/metrace-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9e4f102c15d1f984a2d395ec7b6739e", "sha256": "be9fe736163a695e5f1bd3fb4ee53a500b65ca427d75615d9c908b27ab7ca6bc" }, "downloads": -1, "filename": "metrace-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e9e4f102c15d1f984a2d395ec7b6739e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 966513, "upload_time": "2019-09-29T10:22:41", "url": "https://files.pythonhosted.org/packages/c0/fc/a1c4b5ba8953e0230af9c093888fb3730ddf3bd97d63840b1cbf58caf8df/metrace-1.0.1.tar.gz" } ] }