package procfs

Import Path
	github.com/prometheus/procfs (on go.dev)

Dependency Relation
	imports 19 packages, and imported by one package

Involved Source Files arp.go buddyinfo.go cmdline.go cpuinfo.go cpuinfo_x86.go crypto.go Package procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc. Example: package main import ( "fmt" "log" "github.com/prometheus/procfs" ) func main() { p, err := procfs.Self() if err != nil { log.Fatalf("could not get process: %s", err) } stat, err := p.Stat() if err != nil { log.Fatalf("could not get process stat: %s", err) } fmt.Printf("command: %s\n", stat.Comm) fmt.Printf("cpu time: %fs\n", stat.CPUTime()) fmt.Printf("vsize: %dB\n", stat.VirtualMemory()) fmt.Printf("rss: %dB\n", stat.ResidentMemory()) } fs.go fs_statfs_type.go fscache.go ipvs.go kernel_random.go loadavg.go mdstat.go meminfo.go mountinfo.go mountstats.go net_conntrackstat.go net_dev.go net_dev_snmp6.go net_ip_socket.go net_protocols.go net_route.go net_sockstat.go net_softnet.go net_tcp.go net_tls_stat.go net_udp.go net_unix.go net_wireless.go net_xfrm.go netstat.go proc.go proc_cgroup.go proc_cgroups.go proc_environ.go proc_fdinfo.go proc_interrupts.go proc_io.go proc_limits.go proc_maps.go proc_netstat.go proc_ns.go proc_psi.go proc_smaps.go proc_snmp.go proc_snmp6.go proc_stat.go proc_status.go proc_sys.go schedstat.go slab.go softirqs.go stat.go swaps.go thread.go vm.go zoneinfo.go
Package-Level Type Names (total 93)
/* sort by: | */
ARPEntry contains a single row of the columnar data represented in /proc/net/arp. Name of the device Flags MAC address IP address IsComplete returns true if ARP entry is marked with complete flag. func FS.GatherARPEntries() ([]ARPEntry, error)
A BuddyInfo is the details parsed from /proc/buddyinfo. The data is comprised of an array of free fragments of each size. The sizes are 2^n*PAGE_SIZE, where n is the array index. Node string Sizes []float64 Zone string func FS.BuddyInfo() ([]BuddyInfo, error)
Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the placement of a PID inside a specific control hierarchy. The kernel has two cgroup APIs, v1 and v2. The v1 has one hierarchy per available resource controller, while v2 has one unified hierarchy shared by all controllers. Regardless of v1 or v2, all hierarchies contain all running processes, so the question answerable with a Cgroup struct is 'where is this process in this hierarchy' (where==what path on the specific cgroupfs). By prefixing this path with the mount point of *this specific* hierarchy, you can locate the relevant pseudo-files needed to read/set the data for this PID in this hierarchy Also see http://man7.org/linux/man-pages/man7/cgroups.7.html Controllers using this hierarchy of processes. Controllers are also known as subsystems. For Cgroups V2 this may be empty, as all active controllers use the same hierarchy HierarchyID that can be matched to a named hierarchy using /proc/cgroups. Cgroups V2 only has one hierarchy, so HierarchyID is always 0. For cgroups v1 this is a unique ID number Path of this control group, relative to the mount point of the cgroupfs representing this specific hierarchy func Proc.Cgroups() ([]Cgroup, error)
CgroupSummary models one line from /proc/cgroups. This file contains information about the controllers that are compiled into the kernel. Also see http://man7.org/linux/man-pages/man7/cgroups.7.html The number of control groups in this hierarchy using this controller. This field contains the value 1 if this controller is enabled, or 0 if it has been disabled The unique ID of the cgroup hierarchy on which this controller is mounted. The name of the controller. controller is also known as subsystem. func FS.CgroupSummarys() ([]CgroupSummary, error)
A ConntrackStatEntry represents one line from net/stat/nf_conntrack and contains netfilter conntrack statistics at one CPU core. Delete uint64 DeleteList uint64 Drop uint64 EarlyDrop uint64 Entries uint64 Found uint64 Ignore uint64 Insert uint64 InsertFailed uint64 Invalid uint64 New uint64 SearchRestart uint64 Searched uint64 func FS.ConntrackStat() ([]ConntrackStatEntry, error)
CPUStat shows how much time the cpu spend in various stages. Guest float64 GuestNice float64 IRQ float64 Idle float64 Iowait float64 Nice float64 SoftIRQ float64 Steal float64 System float64 User float64
FS represents the pseudo-filesystem sys, which provides an interface to kernel data structures. AllProcs returns a list of all currently available processes. AllThreads returns a list of all currently available threads for PID. BuddyInfo reads the buddyinfo statistics from the specified `proc` filesystem. CPUInfo returns information about current system CPUs. See https://www.kernel.org/doc/Documentation/filesystems/proc.txt CgroupSummarys returns information about current /proc/cgroups. CmdLine returns the command line of the kernel. ConntrackStat retrieves netfilter's conntrack statistics, split by CPU cores. Crypto parses an crypto-file (/proc/crypto) and returns a slice of structs containing the relevant info. More information available here: https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html Fscacheinfo returns information about current fscache statistics. See https://www.kernel.org/doc/Documentation/filesystems/caching/fscache.txt GatherARPEntries retrieves all the ARP entries, parse the relevant columns, and then return a slice of ARPEntry's. IPVSBackendStatus reads and returns the status of all (virtual,real) server pairs from the specified `proc` filesystem. IPVSStats reads the IPVS statistics from the specified `proc` filesystem. KernelRandom returns values from /proc/sys/kernel/random. LoadAvg returns loadavg from /proc. MDStat parses an mdstat-file (/proc/mdstat) and returns a slice of structs containing the relevant info. More information available here: https://raid.wiki.kernel.org/index.php/Mdstat Meminfo returns an information about current kernel/system memory statistics. See https://www.kernel.org/doc/Documentation/filesystems/proc.txt NetDev returns kernel/system statistics read from /proc/net/dev. Returns kernel/system statistics read from interface files within the /proc/net/dev_snmp6/ directory. NetProtocols reads stats from /proc/net/protocols and returns a map of PortocolStatLine entries. As of this writing no official Linux Documentation exists, however the source is fairly self-explanatory and the format seems stable since its introduction in 2.6.12-rc2 Linux 2.6.12-rc2 - https://elixir.bootlin.com/linux/v2.6.12-rc2/source/net/core/sock.c#L1452 Linux 5.10 - https://elixir.bootlin.com/linux/v5.10.4/source/net/core/sock.c#L3586 ( FS) NetRoute() ([]NetRouteLine, error) NetSockstat retrieves IPv4 socket statistics. NetSockstat6 retrieves IPv6 socket statistics. If IPv6 is disabled on this kernel, the returned error can be checked with os.IsNotExist. NetSoftnetStat reads data from /proc/net/softnet_stat. NetStat retrieves stats from `/proc/net/stat/`. NetTCP returns the IPv4 kernel/networking statistics for TCP datagrams read from /proc/net/tcp. Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET) instead. NetTCP6 returns the IPv6 kernel/networking statistics for TCP datagrams read from /proc/net/tcp6. Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET6) instead. NetTCP6Summary returns already computed statistics like the total queue lengths for TCP datagrams read from /proc/net/tcp6. Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET6) instead. NetTCPSummary returns already computed statistics like the total queue lengths for TCP datagrams read from /proc/net/tcp. Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET) instead. NetUDP returns the IPv4 kernel/networking statistics for UDP datagrams read from /proc/net/udp. NetUDP6 returns the IPv6 kernel/networking statistics for UDP datagrams read from /proc/net/udp6. NetUDP6Summary returns already computed statistics like the total queue lengths for UDP datagrams read from /proc/net/udp6. NetUDPSummary returns already computed statistics like the total queue lengths for UDP datagrams read from /proc/net/udp. NetUNIX returns data read from /proc/net/unix. NewProc returns a process for the given pid. Deprecated: Use fs.Proc() instead. NewStat returns information about current cpu/process statistics. See: https://www.kernel.org/doc/Documentation/filesystems/proc.txt Deprecated: Use fs.Stat() instead. NewTLSStat reads the tls_stat statistics. NewXfrmStat reads the xfrm_stat statistics from the 'proc' filesystem. PSIStatsForResource reads pressure stall information for the specified resource from /proc/pressure/<resource>. At time of writing this can be either "cpu", "memory" or "io". Proc returns a process for the given pid. Schedstat reads data from `/proc/schedstat`. Self returns a process for the current process. SlabInfo reads data from `/proc/slabinfo`. ( FS) Softirqs() (Softirqs, error) Stat returns information about current cpu/process statistics. See: https://www.kernel.org/doc/Documentation/filesystems/proc.txt Swaps returns a slice of all configured swap devices on the system. ( FS) SysctlInts(sysctl string) ([]int, error) ( FS) SysctlStrings(sysctl string) ([]string, error) Thread returns a process for a given PID, TID. VM reads the VM statistics from the specified `proc` filesystem. Wireless returns kernel wireless statistics. Zoneinfo parses an zoneinfo-file (/proc/zoneinfo) and returns a slice of structs containing the relevant info. More information available here: https://www.kernel.org/doc/Documentation/sysctl/vm.txt func NewDefaultFS() (FS, error) func NewFS(mountPoint string) (FS, error)
Fscacheinfo represents fscache statistics. Number of acquire cookie requests seen Number of acq reqs failed on ENOMEM Number of acq reqs rejected due to error Number of acq reqs rejected due to no cache available Number of acq reqs succeeded Number of acq reqs given a NULL parent Number of successful alloc reqs Number of alloc reqs submitted Number of allocation requests seen Number of alloc reqs that waited on lookup completion Number of alloc reqs aborted -ERESTARTSYS Number of alloc reqs aborted due to object death Number of alloc reqs rejected -ENOBUFS Number of alloc reqs waited for CPU time Number of attr changed failed -ENOMEM Number of attr changed ops given CPU time Number of attr changed rejected -ENOBUFS Number of attr changed requests queued Number of attribute changed requests seen Number of object lookups/creations rejected due to lack of space Number of objects culled Number of objects retired when relinquished Number of stale objects deleted Number of in-progress allocate_page() cache ops Number of in-progress allocate_pages() cache ops Number of in-progress alloc_object() cache ops Number of in-progress attr_changed() cache ops Number of in-progress dissociate_pages() cache ops Number of in-progress drop_object() cache ops Number of in-progress grab_object() cache ops CacheopInvalidations uint64 Number of in-progress lookup_complete() cache ops Number of in-progress lookup_object() cache ops Number of in-progress put_object() cache ops Number of in-progress read_or_alloc_page() cache ops Number of in-progress read_or_alloc_pages() cache ops Number of in-progress sync_cache() cache ops Number of in-progress uncache_page() cache ops Number of in-progress update_object() cache ops Number of in-progress write_page() cache ops data storage cookies allocated Number of index cookies allocated InvalidationsNumber uint64 InvalidationsRunning uint64 Number of negative lookups made Number of lookup calls made on cache backends Number of positive lookups made Number of lookups timed out and requeued Number of object allocation failures Number of objects allocated Number of objects that reached the available state Number of objects created by lookup Number of objects that reached the dead state Number of objects that were declared obsolete Number of objects that needed a coherency data update Number of objects that passed a coherency check Number of objects that didn't have a coherency check Number of async ops canceled Number of async ops queued for deferred release Number of times async ops queued for processing Number of deferred-release async ops garbage collected Number of async ops initialized Number of times async ops added to pending queues Number of async ops rejected due to object lookup/create failure Number of async ops released (should equal ini=N when idle) Number of times async ops given CPU time Number of page stores canceled due to release req Number of pages marked as being cached Number of release reqs against pages stored by time lock granted Number of release reqs against pages with no pending store Number of release reqs ignored due to in-progress store Number of relinquish cookie requests seen Number of rlq reqs given a NULL parent Number of rlq reqs waited on completion of creation Relinqs rtr Number of retr reqs aborted -ERESTARTSYS Number of retr reqs aborted due to object death Number of retr reqs failed -ENOMEM Number of successful retr reqs Number of retrieval (read) requests seen Number of retr reqs rejected -ENOBUFS Number of retr reqs submitted Number of retr reqs returned -ENODATA Number of retr reqs waited for CPU time Number of retr reqs that waited on lookup completion Number of special cookies allocated Number of pages given store req processing time Number of store reqs deleted from tracking tree Number of store reqs failed -ENOMEM Number of store reqs on a page already pending storage Number of store reqs over store limit Number of store reqs rejected -ENOBUFS Number of store reqs granted CPU time Number of store reqs submitted Number of successful store reqs Number of storage (write) requests seen Number of uncache page requests seen Number of update cookie requests seen Number of upd reqs granted CPU time Number of upd reqs given a NULL parent VmscanWaiting uint64 func FS.Fscacheinfo() (Fscacheinfo, error)
InType3 *float64 OutType3 *float64
InotifyInfo represents a single inotify line in the fdinfo file. Inode number Mask of events being monitored Device ID Watch descriptor number
Interrupt represents a single interrupt line. Devices is the name of the device that is located at that IRQ Info is the type of interrupt. Values is the number of interrupts per CPU.
IPVSBackendStatus holds current metrics of one virtual / real address pair. The current number of active connections for this virtual/real address pair. The current number of inactive connections for this virtual/real address pair. The local (virtual) IP address. The local firewall mark The local (virtual) port. The transport protocol (TCP, UDP). The remote (real) IP address. The remote (real) port. The current weight of this virtual/real address pair. func FS.IPVSBackendStatus() ([]IPVSBackendStatus, error)
IPVSStats holds IPVS statistics, as exposed by the kernel in `/proc/net/ip_vs_stats`. Total count of connections. Total incoming traffic. Total incoming packages processed. Total outgoing traffic. Total outgoing packages processed. func FS.IPVSStats() (IPVSStats, error)
KernelRandom contains information about to the kernel's random number generator. EntropyAvaliable gives the available entropy, in bits. PoolSize gives the size of the entropy pool, in bits. ReadWakeupThreshold is the number of bits of entropy required for waking up processes that sleep waiting for entropy from /dev/random. URandomMinReseedSeconds is the number of seconds after which the DRNG will be reseeded. WriteWakeupThreshold the number of bits of entropy below which we wake up processes that do a select(2) or poll(2) for write access to /dev/random. func FS.KernelRandom() (KernelRandom, error)
LoadAvg represents an entry in /proc/loadavg. Load1 float64 Load15 float64 Load5 float64 func FS.LoadAvg() (*LoadAvg, error)
MDStat holds info parsed from /proc/mdstat. activity-state of the device. Number of blocks on the device that are in sync. estimated finishing time for current sync (in minutes) progress percentage of current sync current sync speed (in Kilobytes/sec) Number of blocks on the device that need to be synced. Number of blocks the device holds. Name of md component devices Number of active disks. Number of "down" disks. (the _ indicator in the status line) Number of failed disks. Spare disks in the device. Total number of disks the device requires. Name of the device. func FS.MDStat() ([]MDStat, error)
Meminfo represents memory statistics. Memory that has been used more recently and usually not reclaimed unless absolutely necessary. ActiveAnon *uint64 ActiveAnonBytes *uint64 ActiveBytes *uint64 ActiveFile *uint64 ActiveFileBytes *uint64 AnonHugePages *uint64 AnonHugePagesBytes *uint64 Non-file backed pages mapped into userspace page tables AnonPagesBytes *uint64 Memory used for block device "bounce buffers" BounceBytes *uint64 Relatively temporary storage for raw disk blocks shouldn't get tremendously large (20MB or so) BuffersBytes *uint64 Cached *uint64 CachedBytes *uint64 CmaFree *uint64 CmaFreeBytes *uint64 CmaTotal *uint64 CmaTotalBytes *uint64 Based on the overcommit ratio ('vm.overcommit_ratio'), this is the total amount of memory currently available to be allocated on the system. This limit is only adhered to if strict overcommit accounting is enabled (mode 2 in 'vm.overcommit_memory'). The CommitLimit is calculated with the following formula: CommitLimit = ([total RAM pages] - [total huge TLB pages]) * overcommit_ratio / 100 + [total swap pages] For example, on a system with 1G of physical RAM and 7G of swap with a `vm.overcommit_ratio` of 30 it would yield a CommitLimit of 7.3G. For more details, see the memory overcommit documentation in vm/overcommit-accounting. CommitLimitBytes *uint64 The amount of memory presently allocated on the system. The committed memory is a sum of all of the memory which has been allocated by processes, even if it has not been "used" by them as of yet. A process which malloc()'s 1G of memory, but only touches 300M of it will show up as using 1G. This 1G is memory which has been "committed" to by the VM and can be used at any time by the allocating application. With strict overcommit enabled on the system (mode 2 in 'vm.overcommit_memory'),allocations which would exceed the CommitLimit (detailed above) will not be permitted. This is useful if one needs to guarantee that processes will not fail due to lack of memory once that memory has been successfully allocated. CommittedASBytes *uint64 DirectMap1G *uint64 DirectMap1GBytes *uint64 DirectMap2M *uint64 DirectMap2MBytes *uint64 DirectMap4k *uint64 DirectMap4kBytes *uint64 Memory which is waiting to get written back to the disk DirtyBytes *uint64 HardwareCorrupted *uint64 HardwareCorruptedBytes *uint64 HugePagesFree *uint64 HugePagesRsvd *uint64 HugePagesSurp *uint64 HugePagesTotal *uint64 Hugepagesize *uint64 HugepagesizeBytes *uint64 Memory which has been less recently used. It is more eligible to be reclaimed for other purposes InactiveAnon *uint64 InactiveAnonBytes *uint64 InactiveBytes *uint64 InactiveFile *uint64 InactiveFileBytes *uint64 KernelStack *uint64 KernelStackBytes *uint64 files which have been mapped, such as libraries MappedBytes *uint64 An estimate of how much memory is available for starting new applications, without swapping. Calculated from MemFree, SReclaimable, the size of the file LRU lists, and the low watermarks in each zone. The estimate takes into account that the system needs some page cache to function well, and that not all reclaimable slab will be reclaimable, due to items being in use. The impact of those factors will vary from system to system. MemAvailableBytes *uint64 The sum of LowFree+HighFree MemFreeBytes *uint64 Total usable ram (i.e. physical ram minus a few reserved bits and the kernel binary code) The struct fields below are the byte-normalized counterparts to the existing struct fields. Values are normalized using the optional unit field in the meminfo line. Mlocked *uint64 MlockedBytes *uint64 NFS pages sent to the server, but not yet committed to stable storage NFSUnstableBytes *uint64 amount of memory dedicated to the lowest level of page tables. PageTablesBytes *uint64 Percpu *uint64 PercpuBytes *uint64 Part of Slab, that might be reclaimed, such as caches SReclaimableBytes *uint64 Part of Slab, that cannot be reclaimed on memory pressure SUnreclaimBytes *uint64 Shmem *uint64 ShmemBytes *uint64 ShmemHugePages *uint64 ShmemHugePagesBytes *uint64 ShmemPmdMapped *uint64 ShmemPmdMappedBytes *uint64 in-kernel data structures cache SlabBytes *uint64 Memory that once was swapped out, is swapped back in but still also is in the swapfile (if memory is needed it doesn't need to be swapped out AGAIN because it is already in the swapfile. This saves I/O) SwapCachedBytes *uint64 Memory which has been evicted from RAM, and is temporarily on the disk SwapFreeBytes *uint64 total amount of swap space available SwapTotalBytes *uint64 Unevictable *uint64 UnevictableBytes *uint64 largest contiguous block of vmalloc area which is free VmallocChunkBytes *uint64 total size of vmalloc memory area VmallocTotalBytes *uint64 amount of vmalloc area which is used VmallocUsedBytes *uint64 Memory which is actively being written back to the disk WritebackBytes *uint64 Memory used by FUSE for temporary writeback buffers WritebackTmpBytes *uint64 func FS.Meminfo() (Meminfo, error)
A Mount is a device mount parsed from /proc/[pid]/mountstats. Name of the device. The mount point of the device. If available additional statistics related to this Mount. Use a type assertion to determine if additional statistics are available. The filesystem type used by the device. func Proc.MountStats() ([]*Mount, error)
A MountInfo is a type that describes the details, options for each mount, parsed from /proc/self/mountinfo. The fields described in each entry of /proc/self/mountinfo is described in the following man page. http://man7.org/linux/man-pages/man5/proc.5.html The Filesystem type The value of `st_dev` for the files on this FS Unique ID for the mount The pathname of the mount point relative to the root Zero or more optional fields Mount options The ID of the parent mount The pathname of the directory in the FS that forms the root for this mount FS specific information or "none" Superblock options func GetMounts() ([]*MountInfo, error) func GetProcMounts(pid int) ([]*MountInfo, error) func Proc.MountInfo() ([]*MountInfo, error)
A MountStats is a type which contains detailed statistics for a specific type of Mount. MountStatsNFS
A MountStatsNFS is a MountStats implementation for NFSv3 and v4 mounts. The age of the NFS mount. Statistics related to byte counters for various operations. Statistics related to various NFS event occurrences. Statistics broken down by filesystem operation. The mount options of the NFS mount. The version of statistics provided. Statistics about the NFS RPC transport. MountStatsNFS : MountStats
Namespace represents a single namespace of a process. // Inode number of the namespace. If two processes are in the same namespace their inodes will match. // Namespace type.
Namespaces contains all of the namespaces that the process is contained in. func Proc.Namespaces() (Namespaces, error)
NetDev is parsed from /proc/net/dev or /proc/[pid]/net/dev. The map keys are interface names. Total aggregates the values across interfaces and returns a new NetDevLine. The Name field will be a sorted comma separated list of interface names. func FS.NetDev() (NetDev, error) func Proc.NetDev() (NetDev, error)
NetDevLine is single line parsed from /proc/net/dev or /proc/[pid]/net/dev. // The name of the interface. // Cumulative count of bytes received. // Cumulative count of compressed packets received by the device driver. // Cumulative count of packets dropped while receiving. // Cumulative count of receive errors encountered. // Cumulative count of FIFO buffer errors. // Cumulative count of packet framing errors. // Cumulative count of multicast frames received by the device driver. // Cumulative count of packets received. // Cumulative count of bytes transmitted. // Cumulative count of carrier losses detected by the device driver. // Cumulative count of collisions detected on the interface. // Cumulative count of compressed packets transmitted by the device driver. // Cumulative count of packets dropped while transmitting. // Cumulative count of transmit errors encountered. // Cumulative count of FIFO buffer errors. // Cumulative count of packets transmitted. func NetDev.Total() NetDevLine
NetDevSNMP6 is parsed from files in /proc/net/dev_snmp6/ or /proc/<PID>/net/dev_snmp6/. The outer map's keys are interface names and the inner map's keys are stat names. If you'd like a total across all interfaces, please use the Snmp6() method of the Proc type. func FS.NetDevSNMP6() (NetDevSNMP6, error) func Proc.NetDevSNMP6() (NetDevSNMP6, error)
NetIPSocket represents the contents of /proc/net/{t,u}dp{,6} file without the header.
NetIPSocketSummary provides already computed values like the total queue lengths or the total number of used sockets. In contrast to NetIPSocket it does not collect the parsed lines into a slice. Drops shows the total number of dropped packets of all UDP sockets. RxQueueLength shows the total queue length of all parsed rx_queue lengths. TxQueueLength shows the total queue length of all parsed tx_queue lengths. UsedSockets shows the total number of parsed lines representing the number of used sockets.
NetProtocolCapabilities contains a list of capabilities for each protocol. // 11 // 22 // 21 // 8 // 9 // 14 // 10 // 26 // 25 // 17 // 23 // 13 // 12 // 19 // 18 // 20 // 16 // 15 // 24
NetProtocolStatLine contains a single line parsed from /proc/net/protocols. We only care about the first six columns as the rest are not likely to change and only serve to provide a set of capabilities for each protocol. Capabilities NetProtocolCapabilities // 5 Protocol specific max header size // 3 Number of 4KB pages allocated by all sockets of this protocol // 7 The name of the module that implemented this protocol or "kernel" if not from a module // 0 The name of the protocol // 4 This is either yes, no, or NI (not implemented). For the sake of simplicity we treat NI as not experiencing memory pressure. // 1 The size, in bytes, of a given protocol structure. e.g. sizeof(struct tcp_sock) or sizeof(struct unix_sock) // 6 Indicates whether or not memory is allocated from the SLAB // 2 Number of sockets in use by this protocol
NetProtocolStats stores the contents from /proc/net/protocols. func FS.NetProtocols() (NetProtocolStats, error)
A NetRouteLine represents one line from net/route. Destination uint32 Flags uint32 Gateway uint32 IRTT uint32 Iface string MTU uint32 Mask uint32 Metric uint32 RefCnt uint32 Use uint32 Window uint32 func FS.NetRoute() ([]NetRouteLine, error)
A NetSockstat contains the output of /proc/net/sockstat{,6} for IPv4 or IPv6, respectively. Protocols []NetSockstatProtocol Used is non-nil for IPv4 sockstat results, but nil for IPv6. func FS.NetSockstat() (*NetSockstat, error) func FS.NetSockstat6() (*NetSockstat, error)
A NetSockstatProtocol contains statistics about a given socket protocol. Pointer fields indicate that the value may or may not be present on any given protocol. Alloc *int InUse int Mem *int Memory *int Orphan *int Protocol string TW *int
NetStat contains statistics for all the counters from one file. Filename string Stats map[string][]uint64 func FS.NetStat() ([]NetStat, error)
NetTCP represents the contents of /proc/net/tcp{,6} file without the header. func FS.NetTCP() (NetTCP, error) func FS.NetTCP6() (NetTCP, error)
NetTCPSummary provides already computed values like the total queue lengths or the total number of used sockets. In contrast to NetTCP it does not collect the parsed lines into a slice. Drops shows the total number of dropped packets of all UDP sockets. RxQueueLength shows the total queue length of all parsed rx_queue lengths. TxQueueLength shows the total queue length of all parsed tx_queue lengths. UsedSockets shows the total number of parsed lines representing the number of used sockets. func FS.NetTCP6Summary() (*NetTCPSummary, error) func FS.NetTCPSummary() (*NetTCPSummary, error)
NetUDP represents the contents of /proc/net/udp{,6} file without the header. func FS.NetUDP() (NetUDP, error) func FS.NetUDP6() (NetUDP, error)
NetUDPSummary provides already computed values like the total queue lengths or the total number of used sockets. In contrast to NetUDP it does not collect the parsed lines into a slice. Drops shows the total number of dropped packets of all UDP sockets. RxQueueLength shows the total queue length of all parsed rx_queue lengths. TxQueueLength shows the total queue length of all parsed tx_queue lengths. UsedSockets shows the total number of parsed lines representing the number of used sockets. func FS.NetUDP6Summary() (*NetUDPSummary, error) func FS.NetUDPSummary() (*NetUDPSummary, error)
NetUNIX holds the data read from /proc/net/unix. Rows []*NetUNIXLine func FS.NetUNIX() (*NetUNIX, error)
NetUNIXFlags is the type of the flags field. ( NetUNIXFlags) String() string NetUNIXFlags : expvar.Var NetUNIXFlags : fmt.Stringer
NetUNIXLine represents a line of /proc/net/unix. Flags NetUNIXFlags Inode uint64 KernelPtr string Path string Protocol uint64 RefCount uint64 State NetUNIXState Type NetUNIXType
NetUNIXState is the type of the state field. ( NetUNIXState) String() string NetUNIXState : expvar.Var NetUNIXState : fmt.Stringer
NetUNIXType is the type of the type field. ( NetUNIXType) String() string NetUNIXType : expvar.Var NetUNIXType : fmt.Stringer
A NFSBytesStats contains statistics about the number of bytes read and written by an NFS client to and from an NFS server. Number of bytes read using the read() syscall in O_DIRECT mode. Number of bytes written using the write() syscall in O_DIRECT mode. Number of bytes read using the read() syscall. Number of pages read directly via mmap()'d files. Number of bytes read from the NFS server, in total. Number of bytes written using the write() syscall. Number of pages written directly via mmap()'d files. Number of bytes written to the NFS server, in total.
A NFSEventsStats contains statistics about NFS event occurrences. Number of times cached inode attributes are invalidated. Unknown. Possibly unused. Number of times an inode cache is cleared. Number of times cached dentry nodes are re-validated from the server. Number of times cached inode attributes are re-validated from the server. Number of times the NFS server indicated EJUKEBOX; retrieving data from offline storage. Number of NFS v4.1+ pNFS reads. Number of NFS v4.1+ pNFS writes. Number of times the NFS server gave less data than expected while reading. Number of times the NFS server wrote less data than expected while writing. Number of times a file was removed while still open by another process. Number of times files have been truncated. Number of times permissions have been checked. Number of times files have been closed and released. Number of pending writes that have been forcefully flushed to the server. Number of times fsync() has been called on directories and files. Number of times directory entries have been read with getdents(). Number of times locking has been attempted on a file. Number of times a directory lookup has occurred. Number of times files or directories have been open()'d. Number of pages read directly via mmap()'d files. Number of times a group of pages have been read. Number of times attributes have been set on inodes. Number of updates (and potential writes) to pages. Number of pages written directly via mmap()'d files. Number of times a group of pages have been written. Number of times a file has been grown due to writes beyond its existing end.
A NFSOperationStats contains statistics for a single operation. Number of bytes received for this operation, including RPC headers and payload. Number of bytes sent for this operation, including RPC headers and payload. Duration all requests spent queued for transmission before they were sent. Duration from when a request was enqueued to when it was completely handled. Duration it took to get a reply back after the request was transmitted. The count of operations that complete with tk_status < 0. These statuses usually indicate error conditions. Number of times a request has had a major timeout. The name of the operation. Number of requests performed for this operation. Number of times an actual RPC request has been transmitted for this operation.
A NFSTransportStats contains statistics for the NFS mount RPC requests and responses. BadReplyCount uint64 Number of times the NFS server sent a response with a transaction ID unknown to this client. BcallCount uint64 Number of times the client has had to establish a connection from scratch to the NFS server. Number of times the client has made a TCP connection to the NFS server. Duration (in jiffies, a kernel internal unit of time) the NFS mount has spent waiting for connections to the server to be established. A running counter, incremented on each request as the current difference ebetween sends and receives. A running counter, incremented on each request by the current backlog queue size. A running counter, incremented on each request as the current size of the pending queue. A running counter, incremented on each request as the current size of the sending queue. EmptySendctxQ uint64 FailedMarshalCount uint64 FixupCopyCount uint64 HardwayRegisterCount uint64 Duration since the NFS mount last saw any RPC traffic. LocalInvNeeded uint64 Maximum number of simultaneously active RPC requests ever used. MrsAllocated uint64 MrsOrphaned uint64 MrsRecovered uint64 NomsgCallCount uint64 The local port used for the NFS mount. The transport protocol used for the NFS mount. rarely accessed error counters accessed when sending a call Number of RPC responses for this mount received from the NFS server. ReplyChunkCount uint64 ReplyWaitsForSend uint64 Number of RPC requests for this mount sent to the NFS server. accessed when receiving a reply TotalRdmaRequest uint64 WriteChunkCount uint64
Proc provides information about a running process. The process ID. Cgroups reads from /proc/<pid>/cgroups and returns a []*Cgroup struct locating this PID in each process control hierarchy running on this system. On every system (v1 and v2), all hierarchies contain all processes, so the len of the returned struct is equal to the number of active hierarchies on this system. CmdLine returns the command line of a process. Comm returns the command name of a process. Cwd returns the absolute path to the current working directory of the process. Environ reads process environments from `/proc/<pid>/environ`. Executable returns the absolute path of the executable command of a process. FDInfo constructor. On kernels older than 3.8, InotifyInfos will always be empty. FileDescriptorTargets returns the targets of all file descriptors of a process. If a file descriptor is not a symlink to a file (like a socket), that value will be the empty string. FileDescriptors returns the currently open file descriptors of a process. FileDescriptorsInfo retrieves information about all file descriptors of the process. FileDescriptorsLen returns the number of currently open file descriptors of a process. IO creates a new ProcIO instance from a given Proc instance. Interrupts creates a new instance from a given Proc instance. Limits returns the current soft limits of the process. MountInfo retrieves mount information for mount points in a process's namespace. It supplies information missing in `/proc/self/mounts` and fixes various other problems with that file too. MountStats retrieves statistics and configuration for mount points in a process's namespace. Namespaces reads from /proc/<pid>/ns/* to get the namespaces of which the process is a member. NetDev returns kernel/system statistics read from /proc/[pid]/net/dev. Returns kernel/system statistics read from interface files within the /proc/<PID>/net/dev_snmp6/ directory. ( Proc) Netstat() (ProcNetstat, error) NewLimits returns the current soft limits of the process. Deprecated: Use p.Limits() instead. NewStat returns the current status information of the process. Deprecated: Use p.Stat() instead. NewStatus returns the current status information of the process. ProcMaps reads from /proc/[pid]/maps to get the memory-mappings of the process. ProcSMapsRollup reads from /proc/[pid]/smaps_rollup to get summed memory information of the process. If smaps_rollup does not exists (require kernel >= 4.15), the content of /proc/pid/smaps will we read and summed. RootDir returns the absolute path to the process's root directory (as set by chroot). Schedstat returns task scheduling information for the process. ( Proc) Snmp() (ProcSnmp, error) ( Proc) Snmp6() (ProcSnmp6, error) Stat returns the current status information of the process. Thread returns a process for a given TID of Proc. Wchan returns the wchan (wait channel) of a process. func NewProc(pid int) (Proc, error) func Self() (Proc, error) func FS.NewProc(pid int) (Proc, error) func FS.Proc(pid int) (Proc, error) func FS.Self() (Proc, error) func FS.Thread(pid, tid int) (Proc, error) func Proc.Thread(tid int) (Proc, error)
ProcFDInfo contains represents file descriptor information. File descriptor File access mode and status flags Inode number List of inotify lines (structured) in the fdinfo file (kernel 3.8+ only) Mount point ID File offset func Proc.FDInfo(fd string) (*ProcFDInfo, error)
ProcFDInfos represents a list of ProcFDInfo structs. InotifyWatchLen returns the total number of inotify watches. ( ProcFDInfos) Len() int ( ProcFDInfos) Less(i, j int) bool ( ProcFDInfos) Swap(i, j int) ProcFDInfos : sort.Interface func Proc.FileDescriptorsInfo() (ProcFDInfos, error)
ProcIO models the content of /proc/<pid>/io. Bytes written, but taking into account truncation. See Documentation/filesystems/proc.txt in the kernel sources for detailed explanation. Chars read. Bytes read. Read syscalls. Write syscalls. Chars written. Bytes written. func Proc.IO() (ProcIO, error)
ProcLimits represents the soft limits for each of the process's resource limits. For more information see getrlimit(2): http://man7.org/linux/man-pages/man2/getrlimit.2.html. Maximum size of the process's virtual memory address space in bytes. CPU time limit in seconds. Maximum size of a core file. Maximum size of the process's data segment (initialized data, uninitialized data, and heap). Limit on the combined number of flock(2) locks and fcntl(2) leases that this process may establish. Maximum size of files that the process may create. Maximum number of bytes of memory that may be locked into RAM. Limit on the number of bytes that can be allocated for POSIX message queues for the real user ID of the calling process. Limit of the nice priority set using setpriority(2) or nice(2). Value one greater than the maximum file descriptor number that can be opened by this process. Limit of signals that may be queued for the real user ID of the calling process. Maximum number of processes that can be created for the real user ID of the calling process. Limit of the real-time priority set using sched_setscheduler(2) or sched_setparam(2). Limit (in microseconds) on the amount of CPU time that a process scheduled under a real-time scheduling policy may consume without making a blocking system call. Limit of the process's resident set in pages. Maximum size of the process stack in bytes. func Proc.Limits() (ProcLimits, error) func Proc.NewLimits() (ProcLimits, error)
ProcMap contains the process memory-mappings of the process read from `/proc/[pid]/maps`. Device owner of this mapping (major:minor) in Mkdev format. The end address of the current mapping The inode of the device above The current offset into the file/fd (e.g., shared libs) The file or psuedofile (or empty==anonymous) The permissions for this mapping The start address of current mapping. func Proc.ProcMaps() ([]*ProcMap, error)
ProcMapPermissions contains permission settings read from `/proc/[pid]/maps`. mapping has the [X]ecutable flag set mapping is marked as [P]rivate (copy on write) mapping has the [R]ead flag set mapping has the [S]hared flag set mapping has the [W]rite flag set
ProcNetstat models the content of /proc/<pid>/net/netstat. IpExt IpExt IpExt.InBcastOctets *float64 IpExt.InBcastPkts *float64 IpExt.InCEPkts *float64 IpExt.InCsumErrors *float64 IpExt.InECT0Pkts *float64 IpExt.InECT1Pkts *float64 IpExt.InMcastOctets *float64 IpExt.InMcastPkts *float64 IpExt.InNoECTPkts *float64 IpExt.InNoRoutes *float64 IpExt.InOctets *float64 IpExt.InTruncatedPkts *float64 IpExt.OutBcastOctets *float64 IpExt.OutBcastPkts *float64 IpExt.OutMcastOctets *float64 IpExt.OutMcastPkts *float64 IpExt.OutOctets *float64 IpExt.ReasmOverlaps *float64 The process ID. TcpExt TcpExt TcpExt.ArpFilter *float64 TcpExt.BusyPollRxPackets *float64 TcpExt.DelayedACKLocked *float64 TcpExt.DelayedACKLost *float64 TcpExt.DelayedACKs *float64 TcpExt.EmbryonicRsts *float64 TcpExt.IPReversePathFilter *float64 TcpExt.ListenDrops *float64 TcpExt.ListenOverflows *float64 TcpExt.LockDroppedIcmps *float64 TcpExt.OfoPruned *float64 TcpExt.OutOfWindowIcmps *float64 TcpExt.PAWSActive *float64 TcpExt.PAWSEstab *float64 TcpExt.PFMemallocDrop *float64 TcpExt.PruneCalled *float64 TcpExt.RcvPruned *float64 TcpExt.SyncookiesFailed *float64 TcpExt.SyncookiesRecv *float64 TcpExt.SyncookiesSent *float64 TcpExt.TCPACKSkippedChallenge *float64 TcpExt.TCPACKSkippedFinWait2 *float64 TcpExt.TCPACKSkippedPAWS *float64 TcpExt.TCPACKSkippedSeq *float64 TcpExt.TCPACKSkippedSynRecv *float64 TcpExt.TCPACKSkippedTimeWait *float64 TcpExt.TCPAbortFailed *float64 TcpExt.TCPAbortOnClose *float64 TcpExt.TCPAbortOnData *float64 TcpExt.TCPAbortOnLinger *float64 TcpExt.TCPAbortOnMemory *float64 TcpExt.TCPAbortOnTimeout *float64 TcpExt.TCPAutoCorking *float64 TcpExt.TCPBacklogDrop *float64 TcpExt.TCPChallengeACK *float64 TcpExt.TCPDSACKIgnoredNoUndo *float64 TcpExt.TCPDSACKIgnoredOld *float64 TcpExt.TCPDSACKOfoRecv *float64 TcpExt.TCPDSACKOfoSent *float64 TcpExt.TCPDSACKOldSent *float64 TcpExt.TCPDSACKRecv *float64 TcpExt.TCPDSACKUndo *float64 TcpExt.TCPDeferAcceptDrop *float64 TcpExt.TCPFastOpenActive *float64 TcpExt.TCPFastOpenActiveFail *float64 TcpExt.TCPFastOpenBlackhole *float64 TcpExt.TCPFastOpenCookieReqd *float64 TcpExt.TCPFastOpenListenOverflow *float64 TcpExt.TCPFastOpenPassive *float64 TcpExt.TCPFastOpenPassiveFail *float64 TcpExt.TCPFastRetrans *float64 TcpExt.TCPFromZeroWindowAdv *float64 TcpExt.TCPFullUndo *float64 TcpExt.TCPHPAcks *float64 TcpExt.TCPHPHits *float64 TcpExt.TCPHystartDelayCwnd *float64 TcpExt.TCPHystartDelayDetect *float64 TcpExt.TCPHystartTrainCwnd *float64 TcpExt.TCPHystartTrainDetect *float64 TcpExt.TCPKeepAlive *float64 TcpExt.TCPLossFailures *float64 TcpExt.TCPLossProbeRecovery *float64 TcpExt.TCPLossProbes *float64 TcpExt.TCPLossUndo *float64 TcpExt.TCPLostRetransmit *float64 TcpExt.TCPMD5Failure *float64 TcpExt.TCPMD5NotFound *float64 TcpExt.TCPMD5Unexpected *float64 TcpExt.TCPMTUPFail *float64 TcpExt.TCPMTUPSuccess *float64 TcpExt.TCPMemoryPressures *float64 TcpExt.TCPMemoryPressuresChrono *float64 TcpExt.TCPMinTTLDrop *float64 TcpExt.TCPOFODrop *float64 TcpExt.TCPOFOMerge *float64 TcpExt.TCPOFOQueue *float64 TcpExt.TCPOrigDataSent *float64 TcpExt.TCPPartialUndo *float64 TcpExt.TCPPureAcks *float64 TcpExt.TCPRcvCoalesce *float64 TcpExt.TCPRcvCollapsed *float64 TcpExt.TCPRcvQDrop *float64 TcpExt.TCPRenoFailures *float64 TcpExt.TCPRenoRecovery *float64 TcpExt.TCPRenoRecoveryFail *float64 TcpExt.TCPRenoReorder *float64 TcpExt.TCPReqQFullDoCookies *float64 TcpExt.TCPReqQFullDrop *float64 TcpExt.TCPRetransFail *float64 TcpExt.TCPSACKDiscard *float64 TcpExt.TCPSACKReneging *float64 TcpExt.TCPSACKReorder *float64 TcpExt.TCPSYNChallenge *float64 TcpExt.TCPSackFailures *float64 TcpExt.TCPSackMerged *float64 TcpExt.TCPSackRecovery *float64 TcpExt.TCPSackRecoveryFail *float64 TcpExt.TCPSackShiftFallback *float64 TcpExt.TCPSackShifted *float64 TcpExt.TCPSlowStartRetrans *float64 TcpExt.TCPSpuriousRTOs *float64 TcpExt.TCPSpuriousRtxHostQueues *float64 TcpExt.TCPSynRetrans *float64 TcpExt.TCPTSReorder *float64 TcpExt.TCPTimeWaitOverflow *float64 TcpExt.TCPTimeouts *float64 TcpExt.TCPToZeroWindowAdv *float64 TcpExt.TCPWantZeroWindowAdv *float64 TcpExt.TCPWinProbe *float64 TcpExt.TCPWqueueTooBig *float64 TcpExt.TW *float64 TcpExt.TWKilled *float64 TcpExt.TWRecycled *float64 func Proc.Netstat() (ProcNetstat, error)
Procs represents a list of Proc structs. ( Procs) Len() int ( Procs) Less(i, j int) bool ( Procs) Swap(i, j int) Procs : sort.Interface func AllProcs() (Procs, error) func AllThreads(pid int) (Procs, error) func FS.AllProcs() (Procs, error) func FS.AllThreads(pid int) (Procs, error)
ProcSchedstat contains the values from `/proc/<pid>/schedstat`. RunTimeslices uint64 RunningNanoseconds uint64 WaitingNanoseconds uint64 func Proc.Schedstat() (ProcSchedstat, error)
Amount of memory that does not belong to any file. Size in bytes of clean private pages. Size in bytes of dirty private pages. Process's proportional share of this mapping. Amount of memory currently marked as referenced or accessed. Amount of the mapping that is currently resident in RAM. Size in bytes of clean shared pages. Size in bytes of dirty shared pages. Amount would-be-anonymous memory currently on swap. Process's proportional memory on swap. func Proc.ProcSMapsRollup() (ProcSMapsRollup, error)
ProcSnmp models the content of /proc/<pid>/net/snmp. Icmp Icmp Icmp.InAddrMaskReps *float64 Icmp.InAddrMasks *float64 Icmp.InDestUnreachs *float64 Icmp.InEchoReps *float64 Icmp.InEchos *float64 Icmp.InMsgs *float64 Icmp.InParmProbs *float64 Icmp.InRedirects *float64 Icmp.InSrcQuenchs *float64 Icmp.InTimeExcds *float64 Icmp.InTimestampReps *float64 Icmp.InTimestamps *float64 Icmp.OutAddrMaskReps *float64 Icmp.OutAddrMasks *float64 Icmp.OutDestUnreachs *float64 Icmp.OutEchoReps *float64 Icmp.OutEchos *float64 Icmp.OutErrors *float64 Icmp.OutMsgs *float64 Icmp.OutParmProbs *float64 Icmp.OutRedirects *float64 Icmp.OutSrcQuenchs *float64 Icmp.OutTimeExcds *float64 Icmp.OutTimestampReps *float64 Icmp.OutTimestamps *float64 IcmpMsg IcmpMsg IcmpMsg.InType3 *float64 IcmpMsg.OutType3 *float64 Ip Ip Ip.DefaultTTL *float64 Ip.ForwDatagrams *float64 Ip.Forwarding *float64 Ip.FragCreates *float64 Ip.FragFails *float64 Ip.FragOKs *float64 Ip.InAddrErrors *float64 Ip.InDelivers *float64 Ip.InDiscards *float64 Ip.InHdrErrors *float64 Ip.InReceives *float64 Ip.InUnknownProtos *float64 Ip.OutDiscards *float64 Ip.OutNoRoutes *float64 Ip.OutRequests *float64 Ip.ReasmFails *float64 Ip.ReasmOKs *float64 Ip.ReasmReqds *float64 Ip.ReasmTimeout *float64 The process ID. Tcp Tcp Tcp.ActiveOpens *float64 Tcp.AttemptFails *float64 Tcp.CurrEstab *float64 Tcp.EstabResets *float64 Tcp.InErrs *float64 Tcp.InSegs *float64 Tcp.MaxConn *float64 Tcp.OutRsts *float64 Tcp.OutSegs *float64 Tcp.PassiveOpens *float64 Tcp.RetransSegs *float64 Tcp.RtoAlgorithm *float64 Tcp.RtoMax *float64 Tcp.RtoMin *float64 Udp Udp UdpLite UdpLite func Proc.Snmp() (ProcSnmp, error)
ProcSnmp6 models the content of /proc/<pid>/net/snmp6. Icmp6 Icmp6 Icmp6.InDestUnreachs *float64 Icmp6.InEchoReplies *float64 Icmp6.InEchos *float64 Icmp6.InGroupMembQueries *float64 Icmp6.InGroupMembReductions *float64 Icmp6.InGroupMembResponses *float64 Icmp6.InMLDv2Reports *float64 Icmp6.InMsgs *float64 Icmp6.InNeighborAdvertisements *float64 Icmp6.InNeighborSolicits *float64 Icmp6.InParmProblems *float64 Icmp6.InPktTooBigs *float64 Icmp6.InRedirects *float64 Icmp6.InRouterAdvertisements *float64 Icmp6.InRouterSolicits *float64 Icmp6.InTimeExcds *float64 Icmp6.InType1 *float64 Icmp6.InType134 *float64 Icmp6.InType135 *float64 Icmp6.InType136 *float64 Icmp6.InType143 *float64 Icmp6.OutDestUnreachs *float64 Icmp6.OutEchoReplies *float64 Icmp6.OutEchos *float64 Icmp6.OutErrors *float64 Icmp6.OutGroupMembQueries *float64 Icmp6.OutGroupMembReductions *float64 Icmp6.OutGroupMembResponses *float64 Icmp6.OutMLDv2Reports *float64 Icmp6.OutMsgs *float64 Icmp6.OutNeighborAdvertisements *float64 Icmp6.OutNeighborSolicits *float64 Icmp6.OutParmProblems *float64 Icmp6.OutPktTooBigs *float64 Icmp6.OutRedirects *float64 Icmp6.OutRouterAdvertisements *float64 Icmp6.OutRouterSolicits *float64 Icmp6.OutTimeExcds *float64 Icmp6.OutType133 *float64 Icmp6.OutType135 *float64 Icmp6.OutType136 *float64 Icmp6.OutType143 *float64 Ip6 Ip6 Ip6.FragCreates *float64 Ip6.FragFails *float64 Ip6.FragOKs *float64 Ip6.InAddrErrors *float64 Ip6.InBcastOctets *float64 Ip6.InCEPkts *float64 Ip6.InDelivers *float64 Ip6.InDiscards *float64 Ip6.InECT0Pkts *float64 Ip6.InECT1Pkts *float64 Ip6.InHdrErrors *float64 Ip6.InMcastOctets *float64 Ip6.InMcastPkts *float64 Ip6.InNoECTPkts *float64 Ip6.InNoRoutes *float64 Ip6.InOctets *float64 Ip6.InReceives *float64 Ip6.InTooBigErrors *float64 Ip6.InTruncatedPkts *float64 Ip6.InUnknownProtos *float64 Ip6.OutBcastOctets *float64 Ip6.OutDiscards *float64 Ip6.OutForwDatagrams *float64 Ip6.OutMcastOctets *float64 Ip6.OutMcastPkts *float64 Ip6.OutNoRoutes *float64 Ip6.OutOctets *float64 Ip6.OutRequests *float64 Ip6.ReasmFails *float64 Ip6.ReasmOKs *float64 Ip6.ReasmReqds *float64 Ip6.ReasmTimeout *float64 The process ID. Udp6 Udp6 Udp6.IgnoredMulti *float64 UdpLite6 UdpLite6 func Proc.Snmp6() (ProcSnmp6, error)
ProcStat provides status information about the process, read from /proc/[pid]/stat. Guest time of the process's children, measured in clock ticks. The number of major faults that the process's waited-for children have made. The number of minor faults that the process's waited-for children have made. Amount of time that this process's waited-for children have been scheduled in kernel mode, measured in clock ticks. Amount of time that this process's waited-for children have been scheduled in user mode, measured in clock ticks. The filename of the executable. Aggregated block I/O delays, measured in clock ticks (centiseconds). The kernel flags word of the process. Guest time of the process (time spent running a virtual CPU for a guest operating system), measured in clock ticks. The number of major faults the process has made which have required loading a memory page from disk. The number of minor faults the process has made which have not required loading a memory page from disk. The nice value, a value in the range 19 (low priority) to -20 (high priority). Number of threads in this process. The process group ID of the process. The process ID. The PID of the parent of this process. Scheduling policy. For processes running a real-time scheduling policy, this is the negated scheduling priority, minus one. CPU number last executed on. Resident set size in pages. Soft limit in bytes on the rss of the process. Real-time scheduling priority, a number in the range 1 to 99 for processes scheduled under a real-time policy, or 0, for non-real-time processes. Amount of time that this process has been scheduled in kernel mode, measured in clock ticks. The session ID of the process. The time the process started after system boot, the value is expressed in clock ticks. The process state. The ID of the foreground process group of the controlling terminal of the process. The controlling terminal of the process. Amount of time that this process has been scheduled in user mode, measured in clock ticks. Virtual memory size in bytes. CPUTime returns the total CPU user and system time in seconds. ResidentMemory returns the resident memory size in bytes. StartTime returns the unix timestamp of the process in seconds. VirtualMemory returns the virtual memory size in bytes. func Proc.NewStat() (ProcStat, error) func Proc.Stat() (ProcStat, error)
ProcStatus provides status information about the process, read from /proc/[pid]/status. CpusAllowedList: List of cpu cores processes are allowed to run on. GIDs of the process (Real, effective, saved set, and filesystem GIDs) Size of hugetlb memory portions List of Pid namespace. The process name. Number of involuntary context switches. The process ID. Size of resident anonymous memory. // nolint:revive Size of resident file mappings. // nolint:revive Size of resident shared memory. // nolint:revive Thread group ID. UIDs of the process (Real, effective, saved set, and filesystem UIDs) Size of data segments. // nolint:revive Size of text segments. // nolint:revive Peak resident set size. // nolint:revive Locked memory size. // nolint:revive Shared library code size. // nolint:revive Size of second-level page tables. // nolint:revive Page table entries size. // nolint:revive Peak virtual memory size. // nolint:revive Pinned memory size. // nolint:revive Resident set size (sum of RssAnnon RssFile and RssShmem). // nolint:revive Virtual memory size. // nolint:revive Size of stack segments. // nolint:revive Swapped-out virtual memory size by anonymous private. // nolint:revive Number of voluntary context switches. TotalCtxtSwitches returns the total context switch. func Proc.NewStatus() (ProcStatus, error)
PSILine is a single line of values as returned by `/proc/pressure/*`. The Avg entries are averages over n seconds, as a percentage. The Total line is in microseconds. Avg10 float64 Avg300 float64 Avg60 float64 Total uint64
PSIStats represent pressure stall information from /proc/pressure/* "Some" indicates the share of time in which at least some tasks are stalled. "Full" indicates the share of time in which all non-idle tasks are stalled simultaneously. Full *PSILine Some *PSILine func FS.PSIStatsForResource(resource string) (PSIStats, error)
Schedstat contains scheduler statistics from /proc/schedstat See https://www.kernel.org/doc/Documentation/scheduler/sched-stats.txt for a detailed description of what these numbers mean. Note the current kernel documentation claims some of the time units are in jiffies when they are actually in nanoseconds since 2.6.23 with the introduction of CFS. A fix to the documentation is pending. See https://lore.kernel.org/patchwork/project/lkml/list/?series=403473 CPUs []*SchedstatCPU func FS.Schedstat() (*Schedstat, error)
SchedstatCPU contains the values from one "cpu<N>" line. CPUNum string RunTimeslices uint64 RunningNanoseconds uint64 WaitingNanoseconds uint64
Slab represents a slab pool in the kernel. Batch int64 tunables Name string ObjActive int64 ObjNum int64 ObjPerSlab int64 ObjSize int64 PagesPerSlab int64 SharedAvail int64 SharedFactor int64 SlabActive int64 SlabNum int64
SlabInfo represents info for all slabs. Slabs []*Slab func FS.SlabInfo() (SlabInfo, error)
Softirqs represents the softirq statistics. Block []uint64 HRTimer []uint64 Hi []uint64 IRQPoll []uint64 NetRx []uint64 NetTx []uint64 RCU []uint64 Sched []uint64 Tasklet []uint64 Timer []uint64 func FS.Softirqs() (Softirqs, error)
SoftIRQStat represent the softirq statistics as exported in the procfs stat file. A nice introduction can be found at https://0xax.gitbooks.io/linux-insides/content/interrupts/interrupts-9.html It is possible to get per-cpu stats by reading `/proc/softirqs`. Block uint64 BlockIoPoll uint64 Hi uint64 Hrtimer uint64 NetRx uint64 NetTx uint64 Rcu uint64 Sched uint64 Tasklet uint64 Timer uint64
SoftnetStat contains a single row of data from /proc/net/softnet_stat. Number of collision occur while obtaining device lock while transmitting. Number of dropped packets. number of times flow limit has been reached. CPU id owning this softnet_data. Number of processed packets. Number of times cpu woken up received_rps. Softnet backlog status. Number of times processing packets ran out of quota. softnet_data's Width. func FS.NetSoftnetStat() ([]SoftnetStat, error)
Stat represents kernel/system statistics. Boot time in seconds since the Epoch. Per-CPU statistics. Summed up cpu statistics. Number of times a context switch happened. Number of times a numbered IRQ was triggered. Number of times interrupts were handled, which contains numbered and unnumbered IRQs. Number of times a process was created. Number of processes currently blocked (waiting for IO). Number of processes currently running. Detailed softirq statistics. Number of times a softirq was scheduled. func NewStat() (Stat, error) func FS.NewStat() (Stat, error) func FS.Stat() (Stat, error)
Swap represents an entry in /proc/swaps. Filename string Priority int Size int Type string Used int func FS.Swaps() ([]*Swap, error)
ArpFilter *float64 BusyPollRxPackets *float64 DelayedACKLocked *float64 DelayedACKLost *float64 DelayedACKs *float64 EmbryonicRsts *float64 IPReversePathFilter *float64 ListenDrops *float64 ListenOverflows *float64 LockDroppedIcmps *float64 OfoPruned *float64 OutOfWindowIcmps *float64 PAWSActive *float64 PAWSEstab *float64 PFMemallocDrop *float64 PruneCalled *float64 RcvPruned *float64 SyncookiesFailed *float64 SyncookiesRecv *float64 SyncookiesSent *float64 TCPACKSkippedChallenge *float64 TCPACKSkippedFinWait2 *float64 TCPACKSkippedPAWS *float64 TCPACKSkippedSeq *float64 TCPACKSkippedSynRecv *float64 TCPACKSkippedTimeWait *float64 TCPAbortFailed *float64 TCPAbortOnClose *float64 TCPAbortOnData *float64 TCPAbortOnLinger *float64 TCPAbortOnMemory *float64 TCPAbortOnTimeout *float64 TCPAutoCorking *float64 TCPBacklogDrop *float64 TCPChallengeACK *float64 TCPDSACKIgnoredNoUndo *float64 TCPDSACKIgnoredOld *float64 TCPDSACKOfoRecv *float64 TCPDSACKOfoSent *float64 TCPDSACKOldSent *float64 TCPDSACKRecv *float64 TCPDSACKUndo *float64 TCPDeferAcceptDrop *float64 TCPFastOpenActive *float64 TCPFastOpenActiveFail *float64 TCPFastOpenBlackhole *float64 TCPFastOpenCookieReqd *float64 TCPFastOpenListenOverflow *float64 TCPFastOpenPassive *float64 TCPFastOpenPassiveFail *float64 TCPFastRetrans *float64 TCPFromZeroWindowAdv *float64 TCPFullUndo *float64 TCPHPAcks *float64 TCPHPHits *float64 TCPHystartDelayCwnd *float64 TCPHystartDelayDetect *float64 TCPHystartTrainCwnd *float64 TCPHystartTrainDetect *float64 TCPKeepAlive *float64 TCPLossFailures *float64 TCPLossProbeRecovery *float64 TCPLossProbes *float64 TCPLossUndo *float64 TCPLostRetransmit *float64 TCPMD5Failure *float64 TCPMD5NotFound *float64 TCPMD5Unexpected *float64 TCPMTUPFail *float64 TCPMTUPSuccess *float64 TCPMemoryPressures *float64 TCPMemoryPressuresChrono *float64 TCPMinTTLDrop *float64 TCPOFODrop *float64 TCPOFOMerge *float64 TCPOFOQueue *float64 TCPOrigDataSent *float64 TCPPartialUndo *float64 TCPPureAcks *float64 TCPRcvCoalesce *float64 TCPRcvCollapsed *float64 TCPRcvQDrop *float64 TCPRenoFailures *float64 TCPRenoRecovery *float64 TCPRenoRecoveryFail *float64 TCPRenoReorder *float64 TCPReqQFullDoCookies *float64 TCPReqQFullDrop *float64 TCPRetransFail *float64 TCPSACKDiscard *float64 TCPSACKReneging *float64 TCPSACKReorder *float64 TCPSYNChallenge *float64 TCPSackFailures *float64 TCPSackMerged *float64 TCPSackRecovery *float64 TCPSackRecoveryFail *float64 TCPSackShiftFallback *float64 TCPSackShifted *float64 TCPSlowStartRetrans *float64 TCPSpuriousRTOs *float64 TCPSpuriousRtxHostQueues *float64 TCPSynRetrans *float64 TCPTSReorder *float64 TCPTimeWaitOverflow *float64 TCPTimeouts *float64 TCPToZeroWindowAdv *float64 TCPWantZeroWindowAdv *float64 TCPWinProbe *float64 TCPWqueueTooBig *float64 TW *float64 TWKilled *float64 TWRecycled *float64
TLSStat struct represents data in /proc/net/tls_stat. See https://docs.kernel.org/networking/tls.html#statistics number of RX sessions currently installed where NIC handles cryptography number of RX sessions currently installed where host handles cryptography number of TX sessions currently installed where NIC handles cryptography number of TX sessions currently installed where host handles cryptography record decryption failed (e.g. due to incorrect authentication tag) number of RX records which had to be re-decrypted due to TLS_RX_EXPECT_NO_PAD mis-prediction. Note that this counter will also increment for non-data records. number of RX sessions opened with NIC cryptography number of RX resyncs sent to NICs handling cryptography number of data RX records which had to be re-decrypted due to TLS_RX_EXPECT_NO_PAD mis-prediction. number of RX sessions opened with host cryptography number of TX sessions opened with NIC cryptography number of TX sessions opened with host cryptography func NewTLSStat() (TLSStat, error) func FS.NewTLSStat() (TLSStat, error)
The VM interface is described at https://www.kernel.org/doc/Documentation/sysctl/vm.txt Each setting is exposed as a single file. Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array and numa_zonelist_order (deprecated) which is a string. // /proc/sys/vm/admin_reserve_kbytes // /proc/sys/vm/block_dump // /proc/sys/vm/compact_unevictable_allowed // /proc/sys/vm/dirty_background_bytes // /proc/sys/vm/dirty_background_ratio // /proc/sys/vm/dirty_bytes // /proc/sys/vm/dirty_expire_centisecs // /proc/sys/vm/dirty_ratio // /proc/sys/vm/dirty_writeback_centisecs // /proc/sys/vm/dirtytime_expire_seconds // /proc/sys/vm/drop_caches // /proc/sys/vm/extfrag_threshold // /proc/sys/vm/hugetlb_shm_group // /proc/sys/vm/laptop_mode // /proc/sys/vm/legacy_va_layout // /proc/sys/vm/lowmem_reserve_ratio // /proc/sys/vm/max_map_count // /proc/sys/vm/memory_failure_early_kill // /proc/sys/vm/memory_failure_recovery // /proc/sys/vm/min_free_kbytes // /proc/sys/vm/min_slab_ratio // /proc/sys/vm/min_unmapped_ratio // /proc/sys/vm/mmap_min_addr // /proc/sys/vm/nr_hugepages // /proc/sys/vm/nr_hugepages_mempolicy // /proc/sys/vm/nr_overcommit_hugepages // /proc/sys/vm/numa_stat // /proc/sys/vm/numa_zonelist_order // /proc/sys/vm/oom_dump_tasks // /proc/sys/vm/oom_kill_allocating_task // /proc/sys/vm/overcommit_kbytes // /proc/sys/vm/overcommit_memory // /proc/sys/vm/overcommit_ratio // /proc/sys/vm/page-cluster // /proc/sys/vm/panic_on_oom // /proc/sys/vm/percpu_pagelist_fraction // /proc/sys/vm/stat_interval // /proc/sys/vm/swappiness // /proc/sys/vm/user_reserve_kbytes // /proc/sys/vm/vfs_cache_pressure // /proc/sys/vm/watermark_boost_factor // /proc/sys/vm/watermark_scale_factor // /proc/sys/vm/zone_reclaim_mode func FS.VM() (*VM, error)
Wireless models the content of /proc/net/wireless. DiscardedCrypt is the number of discarded packets with wrong code/decode (WEP). DiscardedFrag is the number of discarded packets that can't perform MAC reassembly. DiscardedMisc is the number of discarded packets for other reasons. DiscardedNwid is the number of discarded packets with wrong nwid/essid. DiscardedRetry is the number of discarded packets that reached max MAC retries. MissedBeacon is the number of missed beacons/superframe. Name string QualityLevel is the signal gain (dBm). QualityLink is the link quality. QualityNoise is the signal noise baseline (dBm). Status is the current 4-digit hex value status of the interface. func FS.Wireless() ([]*Wireless, error)
XfrmStat models the contents of /proc/net/xfrm_stat. State hasn’t been fully acquired before use Forward routing of a packet is not allowed No buffer is left All errors which are not matched by other Header Error No policy is found for states e.g. Inbound SAs are correct but no SP is found No state found i.e. either inbound SPI, address, or IPSEC protocol at SA is wrong Policy discards Policy error State is expired State is invalid State has mismatch option e.g. UDP encapsulation type is mismatched Transformation mode specific error Transformation protocol specific error e.g. SA Key is wrong Sequence error e.g. sequence number is out of window No matching template for states e.g. Inbound SAs are correct but SP rule is wrong Bundle check error Bundle generation error All errors which are not matched by others No state was found Policy discads Policy is dead Policy Error State is expired State is invalid, perhaps expired Transportation mode specific error Transformation protocol specific error Sequence error i.e sequence number overflow func NewXfrmStat() (XfrmStat, error) func FS.NewXfrmStat() (XfrmStat, error)
Package-Level Functions (total 11)
AllProcs returns a list of all currently available processes under /proc.
AllThreads returns a list of all currently available threads under /proc/PID.
GetMounts retrieves mountinfo information from `/proc/self/mountinfo`.
GetProcMounts retrieves mountinfo information from a processes' `/proc/<pid>/mountinfo`.
NewDefaultFS returns a new proc FS mounted under the default proc mountPoint. It will error if the mount point directory can't be read or is a file.
NewFS returns a new proc FS mounted under the given proc mountPoint. It will error if the mount point directory can't be read or is a file.
NewProc returns a process for the given pid under /proc.
NewStat returns information about current cpu/process statistics. See https://www.kernel.org/doc/Documentation/filesystems/proc.txt Deprecated: Use fs.Stat() instead.
NewTLSStat reads the tls_stat statistics.
NewXfrmStat reads the xfrm_stat statistics.
Self returns a process for the current process read via /proc/self.
Package-Level Variables (total 3)
Package-Level Constants (total 8)
Completed entry (ha valid).
Don't answer this addresses.
Obsoleted: Want to use a netmask (only for proxy entries).
Permanent entry.
Publish entry.
Has requested trailers.
DefaultMountPoint is the common mount point of the proc filesystem.
SectorSize represents the size of a sector in bytes. It is specific to Linux block I/O operations.