{"id":15356383,"url":"https://github.com/saravanabalagi/pid_usage","last_synced_at":"2026-01-30T04:41:05.461Z","repository":{"id":84130102,"uuid":"258631908","full_name":"saravanabalagi/pid_usage","owner":"saravanabalagi","description":"Lightweight CLI Utility written in C to find current CPU Utilization, RAM Usage and Virtual Memory Usage for a given PID and all it's subprocesses","archived":false,"fork":false,"pushed_at":"2020-05-25T10:55:12.000Z","size":146,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T04:08:52.083Z","etag":null,"topics":["cli-utility","cpu-monitoring","cpu-utilization","process-monitor","ram-monitoring","ram-usage","subprocess-monitoring"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saravanabalagi.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-04-24T21:48:49.000Z","updated_at":"2025-01-30T00:08:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"8e445b99-57cc-44d1-b226-bba06d3f756a","html_url":"https://github.com/saravanabalagi/pid_usage","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"117fd933a2b9e3bb6cfa3f80f8cff5d68b3405ed"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/saravanabalagi/pid_usage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saravanabalagi%2Fpid_usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saravanabalagi%2Fpid_usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saravanabalagi%2Fpid_usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saravanabalagi%2Fpid_usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saravanabalagi","download_url":"https://codeload.github.com/saravanabalagi/pid_usage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saravanabalagi%2Fpid_usage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28902797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T04:02:34.702Z","status":"ssl_error","status_checked_at":"2026-01-30T04:02:33.562Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli-utility","cpu-monitoring","cpu-utilization","process-monitor","ram-monitoring","ram-usage","subprocess-monitoring"],"created_at":"2024-10-01T12:28:33.673Z","updated_at":"2026-01-30T04:41:05.448Z","avatar_url":"https://github.com/saravanabalagi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PID Usage\n\n[![pid-usage](https://snapcraft.io//pid-usage/badge.svg)](https://snapcraft.io/pid-usage)\n[![pid-usage](https://snapcraft.io//pid-usage/trending.svg?name=0)](https://snapcraft.io/pid-usage)\n\nA tiny command line utility to get current CPU Utilization, RAM Usage and Virtual Memory Usage of a process \n(including all its subprocesses) in CSV Format. It's particularly more useful if you're looking to save as a \nCSV file for making graphs.\n\n```sh\npid_usage --pid=5432                                                                                                                                                                                                                         master ✭  \nCPU %, Virtual Memory, Resident Memory\n10.0%, 4601 MiB, 154 MiB\n```\n\n![Screencast](screenshots/screencast.gif)\n\n## Options\n\nYou can customlize the following options:\n\n```\n  -i, --interval=I           (float) Calculate usage every I seconds\n      --no-header            Don't print the header row\n  -p, --pid=PID              (int) PID of program to monitor\n  -r, --repeat=R             (int) Program prints output R times\n  -?, --help                 Give this help list\n      --usage                Give a short usage message\n  -V, --version              Print program version\n\n```\n\n## Installation\n\n#### Install from Snap Store\n\n[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/pid-usage)\n\n#### Install from PPA\n\n```sh\nsudo add-apt-repository ppa:saravanabalagi/linux-utils\nsudo apt update\nsudo apt install pid-usage\n```\n\n#### Download Binary\n\nInstallation instructions for current user, all users, and for temporary execution \ncan be found in [INSTALL.md](INSTALL.md) \n\n## What's wrong with `ps` and `top`?\n\nFirstly, `cpu%` values from `ps` and `top` are not [similar](https://unix.stackexchange.com/q/58539/278762). \n`ps` gives total cpu usage as the percentage of time spent running during the entire lifetime of a process.\nThis value is not current cpu utilization value. `top` gives correct current CPU utilization for a given process. \n\nSecondly, CPU Utilization and memory values of a process in both `ps` and `top` do not include that of it's subprocesses.\n\nFor total cpu utilization, during the first time, `top` gives cpu usage since boot. \nAfter that, it gives cpu usage since the last queried time.\nThis means when you use `top` and parse the cpu percent using `awk` \nin your shell script inside a for loop, the values you get won't be the current cpu utilization!\n\n## Contribution\n\nPull requests are very welcome.\n\n1. Fork the repo\n1. Create new branch with feature name as branch name\n1. Check if things work with a jupyter notebook\n1. Raise a pull request\n\n## Licence\n\nSee attached [Licence](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaravanabalagi%2Fpid_usage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaravanabalagi%2Fpid_usage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaravanabalagi%2Fpid_usage/lists"}