gatus/vendor/github.com/prometheus/procfs
dependabot[bot] 6e92c0eb40 chore(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.11.0 to 1.13.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.11.0...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 23:48:39 -04:00
..
internal chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
.gitignore chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
.golangci.yml chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
arp.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
buddyinfo.go Update dependencies 2021-10-03 22:15:20 -04:00
cmdline.go Update dependencies 2021-10-03 22:15:20 -04:00
CODE_OF_CONDUCT.md chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
CONTRIBUTING.md chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
cpuinfo_armx.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
cpuinfo_mipsx.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
cpuinfo_others.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
cpuinfo_ppcx.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
cpuinfo_riscvx.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
cpuinfo_s390x.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
cpuinfo_x86.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
cpuinfo.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
crypto.go Update dependencies 2021-10-03 22:15:20 -04:00
doc.go Update dependencies 2021-10-03 22:15:20 -04:00
fs.go Fix dependencies 2020-12-25 03:02:44 -05:00
fscache.go Update dependencies 2021-10-03 22:15:20 -04:00
ipvs.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
kernel_random.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
LICENSE Fix dependencies 2020-12-25 03:02:44 -05:00
loadavg.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
MAINTAINERS.md Fix dependencies 2020-12-25 03:02:44 -05:00
Makefile chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
Makefile.common chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
mdstat.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
meminfo.go Update dependencies 2021-10-03 22:15:20 -04:00
mountinfo.go Fix dependencies 2020-12-25 03:02:44 -05:00
mountstats.go Update dependencies 2021-10-03 22:15:20 -04:00
net_conntrackstat.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
net_dev.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
net_ip_socket.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
net_protocols.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
net_sockstat.go Update dependencies 2021-10-03 22:15:20 -04:00
net_softnet.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
net_tcp.go Update dependencies 2021-10-03 22:15:20 -04:00
net_udp.go Update dependencies 2021-10-03 22:15:20 -04:00
net_unix.go Update dependencies 2021-10-03 22:15:20 -04:00
net_xfrm.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
netstat.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
NOTICE Fix dependencies 2020-12-25 03:02:44 -05:00
proc_cgroup.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_cgroups.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_environ.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_fdinfo.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_io.go Fix dependencies 2020-12-25 03:02:44 -05:00
proc_limits.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_maps.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_netstat.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_ns.go Update dependencies 2021-10-03 22:15:20 -04:00
proc_psi.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_smaps.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_snmp6.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_snmp.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_stat.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_status.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc_sys.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
proc.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
README.md Update dependencies 2021-10-03 22:15:20 -04:00
schedstat.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
SECURITY.md chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
slab.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
softirqs.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
stat.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
swaps.go Fix dependencies 2020-12-25 03:02:44 -05:00
ttar Fix dependencies 2020-12-25 03:02:44 -05:00
vm.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00
zoneinfo.go chore(deps): bump github.com/prometheus/client_golang 2022-11-01 23:48:39 -04:00

procfs

This package provides functions to retrieve system, kernel, and process metrics from the pseudo-filesystems /proc and /sys.

WARNING: This package is a work in progress. Its API may still break in backwards-incompatible ways without warnings. Use it at your own risk.

Go Reference CircleCI Go Report Card

Usage

The procfs library is organized by packages based on whether the gathered data is coming from /proc, /sys, or both. Each package contains an FS type which represents the path to either /proc, /sys, or both. For example, cpu statistics are gathered from /proc/stat and are available via the root procfs package. First, the proc filesystem mount point is initialized, and then the stat information is read.

fs, err := procfs.NewFS("/proc")
stats, err := fs.Stat()

Some sub-packages such as blockdevice, require access to both the proc and sys filesystems.

    fs, err := blockdevice.NewFS("/proc", "/sys")
    stats, err := fs.ProcDiskstats()

Package Organization

The packages in this project are organized according to (1) whether the data comes from the /proc or /sys filesystem and (2) the type of information being retrieved. For example, most process information can be gathered from the functions in the root procfs package. Information about block devices such as disk drives is available in the blockdevices sub-package.

Building and Testing

The procfs library is intended to be built as part of another application, so there are no distributable binaries.
However, most of the API includes unit tests which can be run with make test.

Updating Test Fixtures

The procfs library includes a set of test fixtures which include many example files from the /proc and /sys filesystems. These fixtures are included as a ttar file which is extracted automatically during testing. To add/update the test fixtures, first ensure the fixtures directory is up to date by removing the existing directory and then extracting the ttar file using make fixtures/.unpacked or just make test.

rm -rf fixtures
make test

Next, make the required changes to the extracted files in the fixtures directory. When the changes are complete, run make update_fixtures to create a new fixtures.ttar file based on the updated fixtures directory. And finally, verify the changes using git diff fixtures.ttar.