{"id":20887946,"url":"https://github.com/canop/proc-status","last_synced_at":"2025-05-12T19:34:08.476Z","repository":{"id":57657595,"uuid":"344593396","full_name":"Canop/proc-status","owner":"Canop","description":"a crate giving you information about a process, for example yours","archived":false,"fork":false,"pushed_at":"2021-06-02T13:39:53.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-14T16:24:26.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Canop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-04T19:57:36.000Z","updated_at":"2024-09-26T14:20:05.000Z","dependencies_parsed_at":"2022-08-26T04:12:00.539Z","dependency_job_id":null,"html_url":"https://github.com/Canop/proc-status","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fproc-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fproc-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fproc-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fproc-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Canop","download_url":"https://codeload.github.com/Canop/proc-status/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225149646,"owners_count":17428630,"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-11-18T08:23:26.771Z","updated_at":"2024-11-18T08:23:27.408Z","avatar_url":"https://github.com/Canop.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT][s2]][l2] [![Latest Version][s1]][l1] [![docs][s3]][l3] [![Chat on Miaou][s4]][l4]\n\n[s1]: https://img.shields.io/crates/v/proc-status.svg\n[l1]: https://crates.io/crates/proc-status\n\n[s2]: https://img.shields.io/badge/license-MIT-blue.svg\n[l2]: LICENSE\n\n[s3]: https://docs.rs/proc-status/badge.svg\n[l3]: https://docs.rs/proc-status/\n\n[s4]: https://miaou.dystroy.org/static/shields/room.svg\n[l4]: https://miaou.dystroy.org/3\n\n# proc-status\n\nbasic process information\n\nThe data comes from `/proc/\u003cpid\u003e/process` and is only\navailable on unix-like systems.\n\nThis crate aims at keeping very simple.\nIf it doesn't cover your needs, you should probably have a look\nat the much bigger [procfs](https://crates.io/crates/procfs).\n\n# Examples:\n\n## Dump memory info about the current process:\n\n```\nlet mem = proc_status::mem_usage().unwrap();\nprintln!(\"Mem usage in bytes: current={}, peak={}\", mem.current, mem.peak);\n```\nThis prints something like\n\n```stdout\nMem usage in bytes: current=1232896, peak=141430784\n```\n\n\n## Print all the fields of the current process' status:\n\n```\nuse proc_status::ProcStatus;\n\nlet ps = ProcStatus::read().unwrap();\nfor entry in ps.entries() {\n    let entry = entry.unwrap();\n    println!(\"{} = {:?}\", entry.key, entry.value);\n}\n```\n\n## Get the raw value of specific entries\n\n```\nuse proc_status::ProcStatus;\n\nlet ps = ProcStatus::read().unwrap();\nprintln!(\"State: {:?}\", ps.value(\"State\").unwrap());\nprintln!(\"VmPeak in bytes: {:?}\", ps.value_KiB(\"VmPeak\").unwrap() * 1024);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanop%2Fproc-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanop%2Fproc-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanop%2Fproc-status/lists"}