{"id":13465086,"url":"https://github.com/astrofrog/psrecord","last_synced_at":"2025-05-14T12:11:18.036Z","repository":{"id":648260,"uuid":"14958550","full_name":"astrofrog/psrecord","owner":"astrofrog","description":"Record the CPU and memory activity of a process :chart_with_upwards_trend:","archived":false,"fork":false,"pushed_at":"2025-05-05T17:31:44.000Z","size":136,"stargazers_count":620,"open_issues_count":39,"forks_count":79,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-12T17:23:13.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astrofrog.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-12-05T16:09:18.000Z","updated_at":"2025-05-12T12:35:34.000Z","dependencies_parsed_at":"2024-06-03T20:28:47.273Z","dependency_job_id":"09b8b1a4-a126-4a0b-8c84-51e6864731cb","html_url":"https://github.com/astrofrog/psrecord","commit_stats":{"total_commits":97,"total_committers":12,"mean_commits":8.083333333333334,"dds":"0.17525773195876293","last_synced_commit":"cda423ed3fa00fadad66cd7a28ed342748d9f88e"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpsrecord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpsrecord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpsrecord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpsrecord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrofrog","download_url":"https://codeload.github.com/astrofrog/psrecord/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254140760,"owners_count":22021219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T14:00:58.338Z","updated_at":"2025-05-14T12:11:17.969Z","avatar_url":"https://github.com/astrofrog.png","language":"Python","readme":"|Coverage Status|\n\nAbout\n=====\n\n``psrecord`` is a small utility that uses the\n`psutil \u003chttps://github.com/giampaolo/psutil/\u003e`__ library to record the CPU\nand memory activity of a process. The package is still under development\nand is therefore experimental.\n\nThe code is released under a Simplified BSD License, which is given in\nthe ``LICENSE`` file.\n\nRequirements\n============\n\n-  Python 2.7 or 3.3 and higher\n-  `psutil \u003chttps://code.google.com/p/psutil/\u003e`__ 1.0 or later\n-  `matplotlib \u003chttp://www.matplotlib.org\u003e`__ (optional, used for\n   plotting)\n\nInstallation\n============\n\nTo install, simply do::\n\n    pip install psrecord\n\nTo install with the optional plotting dependencies, do::\n\n    pip install psrecord[plot]\n\nUsage\n=====\n\nBasics\n------\n\nTo record the CPU and memory activity of an existing process to a file (use sudo for a root process):\n\n::\n\n    psrecord 1330 --log activity.txt\n\nwhere ``1330`` is an example of a process ID which you can find with\n``ps`` or ``top``. You can also use ``psrecord`` to start up a process\nby specifying the command in quotes:\n\n::\n\n    psrecord \"hyperion model.rtin model.rtout\" --log activity.txt\n\nPlotting\n--------\n\nTo make a plot of the activity:\n\n::\n\n    psrecord 1330 --plot plot.png\n\nThis will produce a plot such as:\n\n.. image:: https://github.com/astrofrog/psrecord/raw/master/screenshot.png\n\nYou can combine these options to write the activity to a file and make a\nplot at the same time:\n\n::\n\n    psrecord 1330 --log activity.txt --plot plot.png\n\nDuration and intervals\n----------------------\n\nBy default, the monitoring will continue until the process is stopped.\nYou can also specify a maximum duration in seconds:\n\n::\n\n    psrecord 1330 --log activity.txt --duration 10\n\nFinally, the process is polled as often as possible by default, but it\nis possible to set the time between samples in seconds:\n\n::\n\n    psrecord 1330 --log activity.txt --interval 2\n\nSubprocesses\n------------\n\nTo include sub-processes in the CPU and memory stats, use:\n\n::\n\n    psrecord 1330 --log activity.txt --include-children\n\nRunning tests\n=============\n\nTo run tests, you will need `pytest \u003chttps://docs.pytest.org/en/latest/\u003e`_. You can install it with::\n\n    pip install pytest\n    \nYou can then run the tests with::\n\n    pytest psrecord\n\nReporting issues\n================\n\nPlease report any issues in the `issue\ntracker \u003chttps://github.com/astrofrog/psrecord/issues\u003e`__.\n\n.. |Coverage Status| image:: https://codecov.io/gh/astrofrog/psrecord/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/astrofrog/psrecord\n","funding_links":[],"categories":["Python","Other"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrofrog%2Fpsrecord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrofrog%2Fpsrecord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrofrog%2Fpsrecord/lists"}