pkg/vendor/github.com/prometheus/procfs
dependabot[bot] c9c48d7059
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846)
* Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.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.16.0...v1.17.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>

* Run ./hack/update-codegen.sh

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-02 06:41:26 +00:00
..
internal Bump github.com/tsenart/vegeta/v12 from 12.8.4 to 12.11.0 (#2772) 2023-08-02 00:16:47 +00:00
.gitignore bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
.golangci.yml Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
CODE_OF_CONDUCT.md bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
CONTRIBUTING.md bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
LICENSE Add stackdriver exporter support in pkg. (#126) 2018-10-24 15:23:31 -07:00
MAINTAINERS.md Switch to Go modules (#1179) 2020-04-28 12:43:51 -07:00
Makefile bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
Makefile.common Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
NOTICE Add stackdriver exporter support in pkg. (#126) 2018-10-24 15:23:31 -07:00
README.md Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
SECURITY.md bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
arp.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
buddyinfo.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
cmdline.go Bump to k8s v0.24.4 client packages (#2586) 2022-09-09 15:07:30 +00:00
cpuinfo.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
cpuinfo_armx.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
cpuinfo_loong64.go Bump github.com/tsenart/vegeta/v12 from 12.8.4 to 12.11.0 (#2772) 2023-08-02 00:16:47 +00:00
cpuinfo_mipsx.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
cpuinfo_others.go Bump github.com/tsenart/vegeta/v12 from 12.8.4 to 12.11.0 (#2772) 2023-08-02 00:16:47 +00:00
cpuinfo_ppcx.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
cpuinfo_riscvx.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
cpuinfo_s390x.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
cpuinfo_x86.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
crypto.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
doc.go Bump github.com/tsenart/vegeta/v12 from 12.8.4 to 12.11.0 (#2772) 2023-08-02 00:16:47 +00:00
fs.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
fs_statfs_notype.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
fs_statfs_type.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
fscache.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
ipvs.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
kernel_random.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
loadavg.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
mdstat.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
meminfo.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
mountinfo.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
mountstats.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_conntrackstat.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_dev.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
net_ip_socket.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_protocols.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_route.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_sockstat.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_softnet.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_tcp.go Bump assorted dependencies (#2086) 2021-04-07 09:09:49 -07:00
net_udp.go Bump assorted dependencies (#2086) 2021-04-07 09:09:49 -07:00
net_unix.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_wireless.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
net_xfrm.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
netstat.go Bump github.com/tsenart/vegeta/v12 from 12.8.4 to 12.11.0 (#2772) 2023-08-02 00:16:47 +00:00
proc.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_cgroup.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_cgroups.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_environ.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
proc_fdinfo.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_interrupts.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_io.go Switch to Go modules (#1179) 2020-04-28 12:43:51 -07:00
proc_limits.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_maps.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_netstat.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_ns.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_psi.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_smaps.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_snmp.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_snmp6.go Bump github.com/tsenart/vegeta/v12 from 12.8.4 to 12.11.0 (#2772) 2023-08-02 00:16:47 +00:00
proc_stat.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
proc_status.go Bump github.com/tsenart/vegeta/v12 from 12.8.4 to 12.11.0 (#2772) 2023-08-02 00:16:47 +00:00
proc_sys.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
schedstat.go bump k8s dependencies and update min version to v1.25 (#2745) 2023-05-23 14:06:11 +00:00
slab.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
softirqs.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
stat.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
swaps.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
thread.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
ttar Switch to Go modules (#1179) 2020-04-28 12:43:51 -07:00
vm.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00
zoneinfo.go Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#2846) 2023-10-02 06:41:26 +00:00

README.md

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 testdata/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 testdata/fixtures.ttar.