cloudflared-mirror/vendor/github.com/prometheus/procfs
Devin Carr 207f4e2c8d TUN-7066: Bump coredns to v1.10.0
closes #857
2023-01-26 09:30:08 -08:00
..
internal TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
.gitignore TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
.golangci.yml TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
CODE_OF_CONDUCT.md TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
CONTRIBUTING.md TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
LICENSE TUN-528: Move cloudflared into a separate repo 2018-07-19 15:02:24 -05:00
MAINTAINERS.md AUTH-2105: Adds support for local forwarding. Refactor auditlogger creation. 2019-10-10 15:25:03 -05:00
Makefile TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
Makefile.common TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
NOTICE TUN-528: Move cloudflared into a separate repo 2018-07-19 15:02:24 -05:00
README.md TUN-5995: Update prometheus to 1.12.1 to avoid vulnerabilities 2022-04-06 11:13:12 +00:00
SECURITY.md TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
arp.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
buddyinfo.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
cmdline.go TUN-5995: Update prometheus to 1.12.1 to avoid vulnerabilities 2022-04-06 11:13:12 +00:00
cpuinfo.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
cpuinfo_armx.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
cpuinfo_mipsx.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
cpuinfo_others.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
cpuinfo_ppcx.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
cpuinfo_riscvx.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
cpuinfo_s390x.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
cpuinfo_x86.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
crypto.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
doc.go TUN-5995: Update prometheus to 1.12.1 to avoid vulnerabilities 2022-04-06 11:13:12 +00:00
fs.go AUTH-2105: Adds support for local forwarding. Refactor auditlogger creation. 2019-10-10 15:25:03 -05:00
fscache.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
ipvs.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
kernel_random.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
loadavg.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
mdstat.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
meminfo.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
mountinfo.go TUN-3375: Upgrade coredns and prometheus dependencies 2020-09-09 13:14:38 -05:00
mountstats.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
net_conntrackstat.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
net_dev.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
net_ip_socket.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
net_protocols.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
net_sockstat.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
net_softnet.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
net_tcp.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
net_udp.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
net_unix.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
net_xfrm.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
netstat.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_cgroup.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_cgroups.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_environ.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_fdinfo.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_io.go TUN-3375: Upgrade coredns and prometheus dependencies 2020-09-09 13:14:38 -05:00
proc_limits.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_maps.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_netstat.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_ns.go TUN-5675: Remove github.com/dgrijalva/jwt-go dependency by upgrading coredns version 2022-01-25 15:24:13 +00:00
proc_psi.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_smaps.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_snmp.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_snmp6.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_stat.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_status.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
proc_sys.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
schedstat.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
slab.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
softirqs.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
stat.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
swaps.go TUN-3375: Upgrade coredns and prometheus dependencies 2020-09-09 13:14:38 -05:00
ttar TUN-2502: Switch to go modules 2019-11-04 15:05:02 -06:00
vm.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08:00
zoneinfo.go TUN-7066: Bump coredns to v1.10.0 2023-01-26 09:30:08 -08: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 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.