{"id":13564442,"url":"https://github.com/prometheus/procfs","last_synced_at":"2025-05-14T11:05:32.114Z","repository":{"id":24934785,"uuid":"28352089","full_name":"prometheus/procfs","owner":"prometheus","description":"procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.","archived":false,"fork":false,"pushed_at":"2025-04-19T17:48:28.000Z","size":1192,"stargazers_count":822,"open_issues_count":47,"forks_count":336,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-07T10:52:32.208Z","etag":null,"topics":["go","kernel","process","process-metrics","procfs","prometheus","pseudo-filesystem-proc"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prometheus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-12-22T18:16:52.000Z","updated_at":"2025-05-07T03:53:15.000Z","dependencies_parsed_at":"2023-10-03T14:14:34.940Z","dependency_job_id":"2b3c4e78-3fa4-4231-aeb2-5a822a7e6e8a","html_url":"https://github.com/prometheus/procfs","commit_stats":{"total_commits":582,"total_committers":175,"mean_commits":"3.3257142857142856","dds":0.872852233676976,"last_synced_commit":"9c0d20a1ae50a490b82c0bb9694d79cb6752dac8"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus%2Fprocfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus%2Fprocfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus%2Fprocfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus%2Fprocfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prometheus","download_url":"https://codeload.github.com/prometheus/procfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254043926,"owners_count":22005037,"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":["go","kernel","process","process-metrics","procfs","prometheus","pseudo-filesystem-proc"],"created_at":"2024-08-01T13:01:31.441Z","updated_at":"2025-05-14T11:05:32.045Z","avatar_url":"https://github.com/prometheus.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# procfs\n\nThis package provides functions to retrieve system, kernel, and process\nmetrics from the pseudo-filesystems /proc and /sys.\n\n*WARNING*: This package is a work in progress. Its API may still break in\nbackwards-incompatible ways without warnings. Use it at your own risk.\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/prometheus/procfs.svg)](https://pkg.go.dev/github.com/prometheus/procfs)\n[![CircleCI](https://circleci.com/gh/prometheus/procfs/tree/master.svg?style=svg)](https://circleci.com/gh/prometheus/procfs/tree/master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/prometheus/procfs)](https://goreportcard.com/report/github.com/prometheus/procfs)\n\n## Usage\n\nThe procfs library is organized by packages based on whether the gathered data is coming from\n/proc, /sys, or both.  Each package contains an `FS` type which represents the path to either /proc, \n/sys, or both.  For example, cpu statistics are gathered from\n`/proc/stat` and are available via the root procfs package.  First, the proc filesystem mount\npoint is initialized, and then the stat information is read.\n\n```go\nfs, err := procfs.NewFS(\"/proc\")\nstats, err := fs.Stat()\n```\n\nSome sub-packages such as `blockdevice`, require access to both the proc and sys filesystems.\n\n```go\n    fs, err := blockdevice.NewFS(\"/proc\", \"/sys\")\n    stats, err := fs.ProcDiskstats()\n```\n\n## Package Organization\n\nThe packages in this project are organized according to (1) whether the data comes from the `/proc` or\n`/sys` filesystem and (2) the type of information being retrieved.  For example, most process information\ncan be gathered from the functions in the root `procfs` package.  Information about block devices such as disk drives\nis available in the `blockdevices` sub-package.\n\n## Building and Testing\n\nThe procfs library is intended to be built as part of another application, so there are no distributable binaries.  \nHowever, most of the API includes unit tests which can be run with `make test`.\n\n### Updating Test Fixtures\n\nThe procfs library includes a set of test fixtures which include many example files from\nthe `/proc` and `/sys` filesystems.  These fixtures are included as a [ttar](https://github.com/ideaship/ttar) file\nwhich is extracted automatically during testing.  To add/update the test fixtures, first\nensure the `testdata/fixtures` directory is up to date by removing the existing directory and then\nextracting the ttar file using `make testdata/fixtures/.unpacked` or just `make test`.\n\n```bash\nrm -rf testdata/fixtures\nmake test\n```\n\nNext, make the required changes to the extracted files in the `testdata/fixtures` directory.  When\nthe changes are complete, run `make update_fixtures` to create a new `fixtures.ttar` file\nbased on the updated `fixtures` directory.  And finally, verify the changes using\n`git diff testdata/fixtures.ttar`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprometheus%2Fprocfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprometheus%2Fprocfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprometheus%2Fprocfs/lists"}