Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.circleci/ | H | 15-Sep-2019 | - | 64 | 58 | |
bcache/ | H | 15-Sep-2019 | - | 629 | 462 | |
blockdevice/ | H | 15-Sep-2019 | - | 315 | 228 | |
internal/ | H | 15-Sep-2019 | - | 464 | 271 | |
iscsi/ | H | 15-Sep-2019 | - | 607 | 466 | |
nfs/ | H | 15-Sep-2019 | - | 1,299 | 1,095 | |
scripts/ | H | 15-Sep-2019 | - | 30 | 12 | |
sysfs/ | H | 15-Sep-2019 | - | 2,198 | 1,616 | |
xfs/ | H | 15-Sep-2019 | - | 1,698 | 1,440 | |
.gitignore | H A D | 15-Sep-2019 | 11 | 2 | 1 | |
.golangci.yml | H A D | 15-Sep-2019 | 144 | 7 | 6 | |
CONTRIBUTING.md | H A D | 15-Sep-2019 | 870 | 19 | 14 | |
LICENSE | H A D | 15-Sep-2019 | 11.1 KiB | 202 | 169 | |
MAINTAINERS.md | H A D | 15-Sep-2019 | 102 | 3 | 2 | |
Makefile | H A D | 15-Sep-2019 | 859 | 30 | 12 | |
Makefile.common | H A D | 15-Sep-2019 | 8.9 KiB | 276 | 201 | |
NOTICE | H A D | 15-Sep-2019 | 237 | 8 | 5 | |
README.md | H A D | 15-Sep-2019 | 2.3 KiB | 54 | 39 | |
arp.go | H A D | 15-Sep-2019 | 2.2 KiB | 86 | 54 | |
arp_test.go | H A D | 15-Sep-2019 | 1.2 KiB | 44 | 24 | |
buddyinfo.go | H A D | 15-Sep-2019 | 2.2 KiB | 86 | 56 | |
buddyinfo_test.go | H A D | 15-Sep-2019 | 2.3 KiB | 75 | 51 | |
cpuinfo.go | H A D | 15-Sep-2019 | 4.2 KiB | 167 | 144 | |
cpuinfo_test.go | H A D | 15-Sep-2019 | 1.9 KiB | 61 | 41 | |
crypto.go | H A D | 15-Sep-2019 | 3.5 KiB | 132 | 105 | |
crypto_test.go | H A D | 15-Sep-2019 | 2.7 KiB | 55 | 35 | |
doc.go | H A D | 15-Sep-2019 | 1.3 KiB | 46 | 1 | |
fixtures.ttar | H A D | 15-Sep-2019 | 163.5 KiB | 4,551 | 4,439 | |
fs.go | H A D | 15-Sep-2019 | 1.4 KiB | 44 | 18 | |
fs_test.go | H A D | 15-Sep-2019 | 1.1 KiB | 40 | 21 | |
go.mod | H A D | 15-Sep-2019 | 136 | 7 | 5 | |
go.sum | H A D | 15-Sep-2019 | 376 | 5 | 4 | |
ipvs.go | H A D | 15-Sep-2019 | 5.9 KiB | 240 | 188 | |
ipvs_test.go | H A D | 15-Sep-2019 | 6.6 KiB | 255 | 229 | |
mdstat.go | H A D | 15-Sep-2019 | 5.6 KiB | 195 | 134 | |
mdstat_test.go | H A D | 15-Sep-2019 | 3.9 KiB | 70 | 47 | |
mountinfo.go | H A D | 15-Sep-2019 | 5.5 KiB | 179 | 123 | |
mountinfo_test.go | H A D | 15-Sep-2019 | 4.6 KiB | 136 | 117 | |
mountstats.go | H A D | 15-Sep-2019 | 18.1 KiB | 622 | 397 | |
mountstats_test.go | H A D | 15-Sep-2019 | 11.9 KiB | 412 | 384 | |
net_dev.go | H A D | 15-Sep-2019 | 6.4 KiB | 207 | 160 | |
net_dev_test.go | H A D | 15-Sep-2019 | 2.5 KiB | 87 | 61 | |
net_softnet.go | H A D | 15-Sep-2019 | 2.8 KiB | 92 | 61 | |
net_softnet_test.go | H A D | 15-Sep-2019 | 1.1 KiB | 43 | 23 | |
net_unix.go | H A D | 15-Sep-2019 | 6.8 KiB | 276 | 208 | |
net_unix_test.go | H A D | 15-Sep-2019 | 3.9 KiB | 180 | 155 | |
proc.go | H A D | 15-Sep-2019 | 7 KiB | 312 | 216 | |
proc_environ.go | H A D | 15-Sep-2019 | 1.1 KiB | 44 | 23 | |
proc_environ_test.go | H A D | 15-Sep-2019 | 1.3 KiB | 48 | 28 | |
proc_fdinfo.go | H A D | 15-Sep-2019 | 3.4 KiB | 133 | 88 | |
proc_fdinfo_test.go | H A D | 15-Sep-2019 | 989 | 35 | 19 | |
proc_io.go | H A D | 15-Sep-2019 | 1.6 KiB | 66 | 33 | |
proc_io_test.go | H A D | 15-Sep-2019 | 1.4 KiB | 47 | 29 | |
proc_limits.go | H A D | 15-Sep-2019 | 4.6 KiB | 158 | 102 | |
proc_limits_test.go | H A D | 15-Sep-2019 | 1.2 KiB | 45 | 27 | |
proc_ns.go | H A D | 15-Sep-2019 | 1.9 KiB | 69 | 41 | |
proc_ns_test.go | H A D | 15-Sep-2019 | 1.2 KiB | 45 | 26 | |
proc_psi.go | H A D | 15-Sep-2019 | 3.3 KiB | 102 | 56 | |
proc_psi_test.go | H A D | 15-Sep-2019 | 3.9 KiB | 150 | 116 | |
proc_stat.go | H A D | 15-Sep-2019 | 5.4 KiB | 199 | 108 | |
proc_stat_test.go | H A D | 15-Sep-2019 | 2.9 KiB | 128 | 98 | |
proc_status.go | H A D | 15-Sep-2019 | 3.9 KiB | 168 | 107 | |
proc_status_test.go | H A D | 15-Sep-2019 | 2.6 KiB | 78 | 59 | |
proc_test.go | H A D | 15-Sep-2019 | 6 KiB | 257 | 225 | |
schedstat.go | H A D | 15-Sep-2019 | 2.9 KiB | 119 | 73 | |
schedstat_test.go | H A D | 15-Sep-2019 | 3.5 KiB | 130 | 94 | |
stat.go | H A D | 15-Sep-2019 | 7 KiB | 245 | 178 | |
stat_test.go | H A D | 15-Sep-2019 | 2.2 KiB | 75 | 41 | |
ttar | H A D | 15-Sep-2019 | 11.6 KiB | 414 | 328 | |
vm.go | H A D | 15-Sep-2019 | 7.7 KiB | 211 | 178 | |
vm_test.go | H A D | 15-Sep-2019 | 2.9 KiB | 86 | 68 | |
xfrm.go | H A D | 15-Sep-2019 | 4.8 KiB | 188 | 127 | |
xfrm_test.go | H A D | 15-Sep-2019 | 3.1 KiB | 67 | 50 | |
zoneinfo.go | H A D | 15-Sep-2019 | 6.3 KiB | 197 | 166 | |
zoneinfo_test.go | H A D | 15-Sep-2019 | 2.6 KiB | 45 | 24 |
README.md
1# procfs 2 3This procfs package provides functions to retrieve system, kernel and process 4metrics from the pseudo-filesystems /proc and /sys. 5 6*WARNING*: This package is a work in progress. Its API may still break in 7backwards-incompatible ways without warnings. Use it at your own risk. 8 9[![GoDoc](https://godoc.org/github.com/prometheus/procfs?status.png)](https://godoc.org/github.com/prometheus/procfs) 10[![Build Status](https://travis-ci.org/prometheus/procfs.svg?branch=master)](https://travis-ci.org/prometheus/procfs) 11[![Go Report Card](https://goreportcard.com/badge/github.com/prometheus/procfs)](https://goreportcard.com/report/github.com/prometheus/procfs) 12 13## Usage 14 15The procfs library is organized by packages based on whether the gathered data is coming from 16/proc, /sys, or both. Each package contains an `FS` type which represents the path to either /proc, /sys, or both. For example, current cpu statistics are gathered from 17`/proc/stat` and are available via the root procfs package. First, the proc filesystem mount 18point is initialized, and then the stat information is read. 19 20```go 21fs, err := procfs.NewFS("/proc") 22stats, err := fs.Stat() 23``` 24 25Some sub-packages such as `blockdevice`, require access to both the proc and sys filesystems. 26 27```go 28 fs, err := blockdevice.NewFS("/proc", "/sys") 29 stats, err := fs.ProcDiskstats() 30``` 31 32## Building and Testing 33 34The procfs library is normally built as part of another application. However, when making 35changes to the library, the `make test` command can be used to run the API test suite. 36 37### Updating Test Fixtures 38 39The procfs library includes a set of test fixtures which include many example files from 40the `/proc` and `/sys` filesystems. These fixtures are included as a [ttar](https://github.com/ideaship/ttar) file 41which is extracted automatically during testing. To add/update the test fixtures, first 42ensure the `fixtures` directory is up to date by removing the existing directory and then 43extracting the ttar file using `make fixtures/.unpacked` or just `make test`. 44 45```bash 46rm -rf fixtures 47make test 48``` 49 50Next, make the required changes to the extracted files in the `fixtures` directory. When 51the changes are complete, run `make update_fixtures` to create a new `fixtures.ttar` file 52based on the updated `fixtures` directory. And finally, verify the changes using 53`git diff fixtures.ttar`. 54