mirror of
				https://github.com/prometheus/node_exporter.git
				synced 2025-08-20 18:33:52 -07:00 
			
		
		
		
	update procfs to v0.0.4 (#1457)
Signed-off-by: Paul Gier <pgier@redhat.com>
This commit is contained in:
		
							parent
							
								
									154d59dee7
								
							
						
					
					
						commit
						0b7ac85acb
					
				
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							| 
						 | 
					@ -15,7 +15,7 @@ require (
 | 
				
			||||||
	github.com/prometheus/client_golang v1.0.0
 | 
						github.com/prometheus/client_golang v1.0.0
 | 
				
			||||||
	github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
 | 
						github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
 | 
				
			||||||
	github.com/prometheus/common v0.4.1
 | 
						github.com/prometheus/common v0.4.1
 | 
				
			||||||
	github.com/prometheus/procfs v0.0.4-0.20190731153504-5da962fa40f1
 | 
						github.com/prometheus/procfs v0.0.4
 | 
				
			||||||
	github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745
 | 
						github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745
 | 
				
			||||||
	github.com/sirupsen/logrus v1.4.2 // indirect
 | 
						github.com/sirupsen/logrus v1.4.2 // indirect
 | 
				
			||||||
	github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a
 | 
						github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										4
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								go.sum
									
									
									
									
									
								
							| 
						 | 
					@ -68,8 +68,8 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
 | 
				
			||||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 | 
					github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
 | 
					github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 | 
					github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.4-0.20190731153504-5da962fa40f1 h1:uqK/YnaVFq1uofHlzj+IR4HhCYA/nbrvJ431l7cm7Vs=
 | 
					github.com/prometheus/procfs v0.0.4 h1:w8DjqFMJDjuVwdZBQoOozr4MVWOnwF7RcL/7uxBjY78=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.4-0.20190731153504-5da962fa40f1/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
 | 
					github.com/prometheus/procfs v0.0.4/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
 | 
				
			||||||
github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 h1:IuH7WumZNax0D+rEqmy2TyhKCzrtMGqbZO0b8rO00JA=
 | 
					github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 h1:IuH7WumZNax0D+rEqmy2TyhKCzrtMGqbZO0b8rO00JA=
 | 
				
			||||||
github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8=
 | 
					github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8=
 | 
				
			||||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 | 
					github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1022
									
								
								vendor/github.com/prometheus/procfs/fixtures.ttar
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1022
									
								
								vendor/github.com/prometheus/procfs/fixtures.ttar
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										159
									
								
								vendor/github.com/prometheus/procfs/sysfs/net_class.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										159
									
								
								vendor/github.com/prometheus/procfs/sysfs/net_class.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
					@ -18,11 +18,7 @@ package sysfs
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"io/ioutil"
 | 
						"io/ioutil"
 | 
				
			||||||
	"os"
 | 
					 | 
				
			||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
	"reflect"
 | 
					 | 
				
			||||||
	"strconv"
 | 
					 | 
				
			||||||
	"strings"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/prometheus/procfs/internal/util"
 | 
						"github.com/prometheus/procfs/internal/util"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					@ -33,32 +29,32 @@ const netclassPath = "class/net"
 | 
				
			||||||
// for single interface (iface).
 | 
					// for single interface (iface).
 | 
				
			||||||
type NetClassIface struct {
 | 
					type NetClassIface struct {
 | 
				
			||||||
	Name             string // Interface name
 | 
						Name             string // Interface name
 | 
				
			||||||
	AddrAssignType   *int64 `fileName:"addr_assign_type"`   // /sys/class/net/<iface>/addr_assign_type
 | 
						AddrAssignType   *int64 // /sys/class/net/<iface>/addr_assign_type
 | 
				
			||||||
	AddrLen          *int64 `fileName:"addr_len"`           // /sys/class/net/<iface>/addr_len
 | 
						AddrLen          *int64 // /sys/class/net/<iface>/addr_len
 | 
				
			||||||
	Address          string `fileName:"address"`            // /sys/class/net/<iface>/address
 | 
						Address          string // /sys/class/net/<iface>/address
 | 
				
			||||||
	Broadcast        string `fileName:"broadcast"`          // /sys/class/net/<iface>/broadcast
 | 
						Broadcast        string // /sys/class/net/<iface>/broadcast
 | 
				
			||||||
	Carrier          *int64 `fileName:"carrier"`            // /sys/class/net/<iface>/carrier
 | 
						Carrier          *int64 // /sys/class/net/<iface>/carrier
 | 
				
			||||||
	CarrierChanges   *int64 `fileName:"carrier_changes"`    // /sys/class/net/<iface>/carrier_changes
 | 
						CarrierChanges   *int64 // /sys/class/net/<iface>/carrier_changes
 | 
				
			||||||
	CarrierUpCount   *int64 `fileName:"carrier_up_count"`   // /sys/class/net/<iface>/carrier_up_count
 | 
						CarrierUpCount   *int64 // /sys/class/net/<iface>/carrier_up_count
 | 
				
			||||||
	CarrierDownCount *int64 `fileName:"carrier_down_count"` // /sys/class/net/<iface>/carrier_down_count
 | 
						CarrierDownCount *int64 // /sys/class/net/<iface>/carrier_down_count
 | 
				
			||||||
	DevID            *int64 `fileName:"dev_id"`             // /sys/class/net/<iface>/dev_id
 | 
						DevID            *int64 // /sys/class/net/<iface>/dev_id
 | 
				
			||||||
	Dormant          *int64 `fileName:"dormant"`            // /sys/class/net/<iface>/dormant
 | 
						Dormant          *int64 // /sys/class/net/<iface>/dormant
 | 
				
			||||||
	Duplex           string `fileName:"duplex"`             // /sys/class/net/<iface>/duplex
 | 
						Duplex           string // /sys/class/net/<iface>/duplex
 | 
				
			||||||
	Flags            *int64 `fileName:"flags"`              // /sys/class/net/<iface>/flags
 | 
						Flags            *int64 // /sys/class/net/<iface>/flags
 | 
				
			||||||
	IfAlias          string `fileName:"ifalias"`            // /sys/class/net/<iface>/ifalias
 | 
						IfAlias          string // /sys/class/net/<iface>/ifalias
 | 
				
			||||||
	IfIndex          *int64 `fileName:"ifindex"`            // /sys/class/net/<iface>/ifindex
 | 
						IfIndex          *int64 // /sys/class/net/<iface>/ifindex
 | 
				
			||||||
	IfLink           *int64 `fileName:"iflink"`             // /sys/class/net/<iface>/iflink
 | 
						IfLink           *int64 // /sys/class/net/<iface>/iflink
 | 
				
			||||||
	LinkMode         *int64 `fileName:"link_mode"`          // /sys/class/net/<iface>/link_mode
 | 
						LinkMode         *int64 // /sys/class/net/<iface>/link_mode
 | 
				
			||||||
	MTU              *int64 `fileName:"mtu"`                // /sys/class/net/<iface>/mtu
 | 
						MTU              *int64 // /sys/class/net/<iface>/mtu
 | 
				
			||||||
	NameAssignType   *int64 `fileName:"name_assign_type"`   // /sys/class/net/<iface>/name_assign_type
 | 
						NameAssignType   *int64 // /sys/class/net/<iface>/name_assign_type
 | 
				
			||||||
	NetDevGroup      *int64 `fileName:"netdev_group"`       // /sys/class/net/<iface>/netdev_group
 | 
						NetDevGroup      *int64 // /sys/class/net/<iface>/netdev_group
 | 
				
			||||||
	OperState        string `fileName:"operstate"`          // /sys/class/net/<iface>/operstate
 | 
						OperState        string // /sys/class/net/<iface>/operstate
 | 
				
			||||||
	PhysPortID       string `fileName:"phys_port_id"`       // /sys/class/net/<iface>/phys_port_id
 | 
						PhysPortID       string // /sys/class/net/<iface>/phys_port_id
 | 
				
			||||||
	PhysPortName     string `fileName:"phys_port_name"`     // /sys/class/net/<iface>/phys_port_name
 | 
						PhysPortName     string // /sys/class/net/<iface>/phys_port_name
 | 
				
			||||||
	PhysSwitchID     string `fileName:"phys_switch_id"`     // /sys/class/net/<iface>/phys_switch_id
 | 
						PhysSwitchID     string // /sys/class/net/<iface>/phys_switch_id
 | 
				
			||||||
	Speed            *int64 `fileName:"speed"`              // /sys/class/net/<iface>/speed
 | 
						Speed            *int64 // /sys/class/net/<iface>/speed
 | 
				
			||||||
	TxQueueLen       *int64 `fileName:"tx_queue_len"`       // /sys/class/net/<iface>/tx_queue_len
 | 
						TxQueueLen       *int64 // /sys/class/net/<iface>/tx_queue_len
 | 
				
			||||||
	Type             *int64 `fileName:"type"`               // /sys/class/net/<iface>/type
 | 
						Type             *int64 // /sys/class/net/<iface>/type
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NetClass is collection of info for every interface (iface) in /sys/class/net. The map keys
 | 
					// NetClass is collection of info for every interface (iface) in /sys/class/net. The map keys
 | 
				
			||||||
| 
						 | 
					@ -109,54 +105,77 @@ func (fs FS) NetClass() (NetClass, error) {
 | 
				
			||||||
// directory and gets their contents.
 | 
					// directory and gets their contents.
 | 
				
			||||||
func (nc NetClass) parseNetClassIface(devicePath string) (*NetClassIface, error) {
 | 
					func (nc NetClass) parseNetClassIface(devicePath string) (*NetClassIface, error) {
 | 
				
			||||||
	interfaceClass := NetClassIface{}
 | 
						interfaceClass := NetClassIface{}
 | 
				
			||||||
	interfaceElem := reflect.ValueOf(&interfaceClass).Elem()
 | 
					 | 
				
			||||||
	interfaceType := reflect.TypeOf(interfaceClass)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//start from 1 - skip the Name field
 | 
						files, err := ioutil.ReadDir(devicePath)
 | 
				
			||||||
	for i := 1; i < interfaceElem.NumField(); i++ {
 | 
						if err != nil {
 | 
				
			||||||
		fieldType := interfaceType.Field(i)
 | 
							return nil, err
 | 
				
			||||||
		fieldValue := interfaceElem.Field(i)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if fieldType.Tag.Get("fileName") == "" {
 | 
					 | 
				
			||||||
			panic(fmt.Errorf("field %s does not have a filename tag", fieldType.Name))
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		value, err := util.SysReadFile(devicePath + "/" + fieldType.Tag.Get("fileName"))
 | 
						for _, f := range files {
 | 
				
			||||||
 | 
							if f.IsDir() {
 | 
				
			||||||
		if err != nil {
 | 
					 | 
				
			||||||
			if os.IsNotExist(err) || err.Error() == "operation not supported" || err.Error() == "invalid argument" {
 | 
					 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
			return nil, fmt.Errorf("could not access file %s: %s", fieldType.Tag.Get("fileName"), err)
 | 
							name := filepath.Join(devicePath, f.Name())
 | 
				
			||||||
		}
 | 
							value, err := util.SysReadFile(name)
 | 
				
			||||||
 | 
					 | 
				
			||||||
		switch fieldValue.Kind() {
 | 
					 | 
				
			||||||
		case reflect.String:
 | 
					 | 
				
			||||||
			fieldValue.SetString(value)
 | 
					 | 
				
			||||||
		case reflect.Ptr:
 | 
					 | 
				
			||||||
			var int64ptr *int64
 | 
					 | 
				
			||||||
			switch fieldValue.Type() {
 | 
					 | 
				
			||||||
			case reflect.TypeOf(int64ptr):
 | 
					 | 
				
			||||||
				var intValue int64
 | 
					 | 
				
			||||||
				if strings.HasPrefix(value, "0x") {
 | 
					 | 
				
			||||||
					intValue, err = strconv.ParseInt(value[2:], 16, 64)
 | 
					 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
						return nil, fmt.Errorf("expected hex value for %s, got: %s", fieldType.Name, value)
 | 
								return nil, fmt.Errorf("failed to read file %q: %v", name, err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
				} else {
 | 
							vp := util.NewValueParser(value)
 | 
				
			||||||
					intValue, err = strconv.ParseInt(value, 10, 64)
 | 
							switch f.Name() {
 | 
				
			||||||
					if err != nil {
 | 
							case "addr_assign_type":
 | 
				
			||||||
						return nil, fmt.Errorf("expected Uint64 value for %s, got: %s", fieldType.Name, value)
 | 
								interfaceClass.AddrAssignType = vp.PInt64()
 | 
				
			||||||
 | 
							case "addr_len":
 | 
				
			||||||
 | 
								interfaceClass.AddrLen = vp.PInt64()
 | 
				
			||||||
 | 
							case "address":
 | 
				
			||||||
 | 
								interfaceClass.Address = value
 | 
				
			||||||
 | 
							case "broadcast":
 | 
				
			||||||
 | 
								interfaceClass.Broadcast = value
 | 
				
			||||||
 | 
							case "carrier":
 | 
				
			||||||
 | 
								interfaceClass.Carrier = vp.PInt64()
 | 
				
			||||||
 | 
							case "carrier_changes":
 | 
				
			||||||
 | 
								interfaceClass.CarrierChanges = vp.PInt64()
 | 
				
			||||||
 | 
							case "carrier_up_count":
 | 
				
			||||||
 | 
								interfaceClass.CarrierUpCount = vp.PInt64()
 | 
				
			||||||
 | 
							case "carrier_down_count":
 | 
				
			||||||
 | 
								interfaceClass.CarrierDownCount = vp.PInt64()
 | 
				
			||||||
 | 
							case "dev_id":
 | 
				
			||||||
 | 
								interfaceClass.DevID = vp.PInt64()
 | 
				
			||||||
 | 
							case "dormant":
 | 
				
			||||||
 | 
								interfaceClass.Dormant = vp.PInt64()
 | 
				
			||||||
 | 
							case "duplex":
 | 
				
			||||||
 | 
								interfaceClass.Duplex = value
 | 
				
			||||||
 | 
							case "flags":
 | 
				
			||||||
 | 
								interfaceClass.Flags = vp.PInt64()
 | 
				
			||||||
 | 
							case "ifalias":
 | 
				
			||||||
 | 
								interfaceClass.IfAlias = value
 | 
				
			||||||
 | 
							case "ifindex":
 | 
				
			||||||
 | 
								interfaceClass.IfIndex = vp.PInt64()
 | 
				
			||||||
 | 
							case "iflink":
 | 
				
			||||||
 | 
								interfaceClass.IfLink = vp.PInt64()
 | 
				
			||||||
 | 
							case "link_mode":
 | 
				
			||||||
 | 
								interfaceClass.LinkMode = vp.PInt64()
 | 
				
			||||||
 | 
							case "mtu":
 | 
				
			||||||
 | 
								interfaceClass.MTU = vp.PInt64()
 | 
				
			||||||
 | 
							case "name_assign_type":
 | 
				
			||||||
 | 
								interfaceClass.NameAssignType = vp.PInt64()
 | 
				
			||||||
 | 
							case "netdev_group":
 | 
				
			||||||
 | 
								interfaceClass.NetDevGroup = vp.PInt64()
 | 
				
			||||||
 | 
							case "operstate":
 | 
				
			||||||
 | 
								interfaceClass.OperState = value
 | 
				
			||||||
 | 
							case "phys_port_id":
 | 
				
			||||||
 | 
								interfaceClass.PhysPortID = value
 | 
				
			||||||
 | 
							case "phys_port_name":
 | 
				
			||||||
 | 
								interfaceClass.PhysPortName = value
 | 
				
			||||||
 | 
							case "phys_switch_id":
 | 
				
			||||||
 | 
								interfaceClass.PhysSwitchID = value
 | 
				
			||||||
 | 
							case "speed":
 | 
				
			||||||
 | 
								interfaceClass.Speed = vp.PInt64()
 | 
				
			||||||
 | 
							case "tx_queue_len":
 | 
				
			||||||
 | 
								interfaceClass.TxQueueLen = vp.PInt64()
 | 
				
			||||||
 | 
							case "type":
 | 
				
			||||||
 | 
								interfaceClass.Type = vp.PInt64()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
				fieldValue.Set(reflect.ValueOf(&intValue))
 | 
					 | 
				
			||||||
			default:
 | 
					 | 
				
			||||||
				return nil, fmt.Errorf("unhandled pointer type %q", fieldValue.Type())
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		default:
 | 
					 | 
				
			||||||
			return nil, fmt.Errorf("unhandled type %q", fieldValue.Kind())
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return &interfaceClass, nil
 | 
						return &interfaceClass, nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										172
									
								
								vendor/github.com/prometheus/procfs/vm.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										172
									
								
								vendor/github.com/prometheus/procfs/vm.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
					@ -31,49 +31,49 @@ import (
 | 
				
			||||||
// Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array
 | 
					// 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
 | 
					// and numa_zonelist_order (deprecated) which is a string
 | 
				
			||||||
type VM struct {
 | 
					type VM struct {
 | 
				
			||||||
	AdminReserveKbytes        int64   // /proc/sys/vm/admin_reserve_kbytes
 | 
						AdminReserveKbytes        *int64   // /proc/sys/vm/admin_reserve_kbytes
 | 
				
			||||||
	BlockDump                 int64   // /proc/sys/vm/block_dump
 | 
						BlockDump                 *int64   // /proc/sys/vm/block_dump
 | 
				
			||||||
	CompactUnevictableAllowed int64   // /proc/sys/vm/compact_unevictable_allowed
 | 
						CompactUnevictableAllowed *int64   // /proc/sys/vm/compact_unevictable_allowed
 | 
				
			||||||
	DirtyBackgroundBytes      int64   // /proc/sys/vm/dirty_background_bytes
 | 
						DirtyBackgroundBytes      *int64   // /proc/sys/vm/dirty_background_bytes
 | 
				
			||||||
	DirtyBackgroundRatio      int64   // /proc/sys/vm/dirty_background_ratio
 | 
						DirtyBackgroundRatio      *int64   // /proc/sys/vm/dirty_background_ratio
 | 
				
			||||||
	DirtyBytes                int64   // /proc/sys/vm/dirty_bytes
 | 
						DirtyBytes                *int64   // /proc/sys/vm/dirty_bytes
 | 
				
			||||||
	DirtyExpireCentisecs      int64   // /proc/sys/vm/dirty_expire_centisecs
 | 
						DirtyExpireCentisecs      *int64   // /proc/sys/vm/dirty_expire_centisecs
 | 
				
			||||||
	DirtyRatio                int64   // /proc/sys/vm/dirty_ratio
 | 
						DirtyRatio                *int64   // /proc/sys/vm/dirty_ratio
 | 
				
			||||||
	DirtytimeExpireSeconds    int64   // /proc/sys/vm/dirtytime_expire_seconds
 | 
						DirtytimeExpireSeconds    *int64   // /proc/sys/vm/dirtytime_expire_seconds
 | 
				
			||||||
	DirtyWritebackCentisecs   int64   // /proc/sys/vm/dirty_writeback_centisecs
 | 
						DirtyWritebackCentisecs   *int64   // /proc/sys/vm/dirty_writeback_centisecs
 | 
				
			||||||
	DropCaches                int64   // /proc/sys/vm/drop_caches
 | 
						DropCaches                *int64   // /proc/sys/vm/drop_caches
 | 
				
			||||||
	ExtfragThreshold          int64   // /proc/sys/vm/extfrag_threshold
 | 
						ExtfragThreshold          *int64   // /proc/sys/vm/extfrag_threshold
 | 
				
			||||||
	HugetlbShmGroup           int64   // /proc/sys/vm/hugetlb_shm_group
 | 
						HugetlbShmGroup           *int64   // /proc/sys/vm/hugetlb_shm_group
 | 
				
			||||||
	LaptopMode                int64   // /proc/sys/vm/laptop_mode
 | 
						LaptopMode                *int64   // /proc/sys/vm/laptop_mode
 | 
				
			||||||
	LegacyVaLayout            int64   // /proc/sys/vm/legacy_va_layout
 | 
						LegacyVaLayout            *int64   // /proc/sys/vm/legacy_va_layout
 | 
				
			||||||
	LowmemReserveRatio        []int64 // /proc/sys/vm/lowmem_reserve_ratio
 | 
						LowmemReserveRatio        []*int64 // /proc/sys/vm/lowmem_reserve_ratio
 | 
				
			||||||
	MaxMapCount               int64   // /proc/sys/vm/max_map_count
 | 
						MaxMapCount               *int64   // /proc/sys/vm/max_map_count
 | 
				
			||||||
	MemoryFailureEarlyKill    int64   // /proc/sys/vm/memory_failure_early_kill
 | 
						MemoryFailureEarlyKill    *int64   // /proc/sys/vm/memory_failure_early_kill
 | 
				
			||||||
	MemoryFailureRecovery     int64   // /proc/sys/vm/memory_failure_recovery
 | 
						MemoryFailureRecovery     *int64   // /proc/sys/vm/memory_failure_recovery
 | 
				
			||||||
	MinFreeKbytes             int64   // /proc/sys/vm/min_free_kbytes
 | 
						MinFreeKbytes             *int64   // /proc/sys/vm/min_free_kbytes
 | 
				
			||||||
	MinSlabRatio              int64   // /proc/sys/vm/min_slab_ratio
 | 
						MinSlabRatio              *int64   // /proc/sys/vm/min_slab_ratio
 | 
				
			||||||
	MinUnmappedRatio          int64   // /proc/sys/vm/min_unmapped_ratio
 | 
						MinUnmappedRatio          *int64   // /proc/sys/vm/min_unmapped_ratio
 | 
				
			||||||
	MmapMinAddr               int64   // /proc/sys/vm/mmap_min_addr
 | 
						MmapMinAddr               *int64   // /proc/sys/vm/mmap_min_addr
 | 
				
			||||||
	NrHugepages               int64   // /proc/sys/vm/nr_hugepages
 | 
						NrHugepages               *int64   // /proc/sys/vm/nr_hugepages
 | 
				
			||||||
	NrHugepagesMempolicy      int64   // /proc/sys/vm/nr_hugepages_mempolicy
 | 
						NrHugepagesMempolicy      *int64   // /proc/sys/vm/nr_hugepages_mempolicy
 | 
				
			||||||
	NrOvercommitHugepages     int64   // /proc/sys/vm/nr_overcommit_hugepages
 | 
						NrOvercommitHugepages     *int64   // /proc/sys/vm/nr_overcommit_hugepages
 | 
				
			||||||
	NumaStat                  int64   // /proc/sys/vm/numa_stat
 | 
						NumaStat                  *int64   // /proc/sys/vm/numa_stat
 | 
				
			||||||
	NumaZonelistOrder         string   // /proc/sys/vm/numa_zonelist_order
 | 
						NumaZonelistOrder         string   // /proc/sys/vm/numa_zonelist_order
 | 
				
			||||||
	OomDumpTasks              int64   // /proc/sys/vm/oom_dump_tasks
 | 
						OomDumpTasks              *int64   // /proc/sys/vm/oom_dump_tasks
 | 
				
			||||||
	OomKillAllocatingTask     int64   // /proc/sys/vm/oom_kill_allocating_task
 | 
						OomKillAllocatingTask     *int64   // /proc/sys/vm/oom_kill_allocating_task
 | 
				
			||||||
	OvercommitKbytes          int64   // /proc/sys/vm/overcommit_kbytes
 | 
						OvercommitKbytes          *int64   // /proc/sys/vm/overcommit_kbytes
 | 
				
			||||||
	OvercommitMemory          int64   // /proc/sys/vm/overcommit_memory
 | 
						OvercommitMemory          *int64   // /proc/sys/vm/overcommit_memory
 | 
				
			||||||
	OvercommitRatio           int64   // /proc/sys/vm/overcommit_ratio
 | 
						OvercommitRatio           *int64   // /proc/sys/vm/overcommit_ratio
 | 
				
			||||||
	PageCluster               int64   // /proc/sys/vm/page-cluster
 | 
						PageCluster               *int64   // /proc/sys/vm/page-cluster
 | 
				
			||||||
	PanicOnOom                int64   // /proc/sys/vm/panic_on_oom
 | 
						PanicOnOom                *int64   // /proc/sys/vm/panic_on_oom
 | 
				
			||||||
	PercpuPagelistFraction    int64   // /proc/sys/vm/percpu_pagelist_fraction
 | 
						PercpuPagelistFraction    *int64   // /proc/sys/vm/percpu_pagelist_fraction
 | 
				
			||||||
	StatInterval              int64   // /proc/sys/vm/stat_interval
 | 
						StatInterval              *int64   // /proc/sys/vm/stat_interval
 | 
				
			||||||
	Swappiness                int64   // /proc/sys/vm/swappiness
 | 
						Swappiness                *int64   // /proc/sys/vm/swappiness
 | 
				
			||||||
	UserReserveKbytes         int64   // /proc/sys/vm/user_reserve_kbytes
 | 
						UserReserveKbytes         *int64   // /proc/sys/vm/user_reserve_kbytes
 | 
				
			||||||
	VfsCachePressure          int64   // /proc/sys/vm/vfs_cache_pressure
 | 
						VfsCachePressure          *int64   // /proc/sys/vm/vfs_cache_pressure
 | 
				
			||||||
	WatermarkBoostFactor      int64   // /proc/sys/vm/watermark_boost_factor
 | 
						WatermarkBoostFactor      *int64   // /proc/sys/vm/watermark_boost_factor
 | 
				
			||||||
	WatermarkScaleFactor      int64   // /proc/sys/vm/watermark_scale_factor
 | 
						WatermarkScaleFactor      *int64   // /proc/sys/vm/watermark_scale_factor
 | 
				
			||||||
	ZoneReclaimMode           int64   // /proc/sys/vm/zone_reclaim_mode
 | 
						ZoneReclaimMode           *int64   // /proc/sys/vm/zone_reclaim_mode
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// VM reads the VM statistics from the specified `proc` filesystem.
 | 
					// VM reads the VM statistics from the specified `proc` filesystem.
 | 
				
			||||||
| 
						 | 
					@ -109,97 +109,97 @@ func (fs FS) VM() (*VM, error) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		switch f.Name() {
 | 
							switch f.Name() {
 | 
				
			||||||
		case "admin_reserve_kbytes":
 | 
							case "admin_reserve_kbytes":
 | 
				
			||||||
			vm.AdminReserveKbytes = *vp.PInt64()
 | 
								vm.AdminReserveKbytes = vp.PInt64()
 | 
				
			||||||
		case "block_dump":
 | 
							case "block_dump":
 | 
				
			||||||
			vm.BlockDump = *vp.PInt64()
 | 
								vm.BlockDump = vp.PInt64()
 | 
				
			||||||
		case "compact_unevictable_allowed":
 | 
							case "compact_unevictable_allowed":
 | 
				
			||||||
			vm.CompactUnevictableAllowed = *vp.PInt64()
 | 
								vm.CompactUnevictableAllowed = vp.PInt64()
 | 
				
			||||||
		case "dirty_background_bytes":
 | 
							case "dirty_background_bytes":
 | 
				
			||||||
			vm.DirtyBackgroundBytes = *vp.PInt64()
 | 
								vm.DirtyBackgroundBytes = vp.PInt64()
 | 
				
			||||||
		case "dirty_background_ratio":
 | 
							case "dirty_background_ratio":
 | 
				
			||||||
			vm.DirtyBackgroundRatio = *vp.PInt64()
 | 
								vm.DirtyBackgroundRatio = vp.PInt64()
 | 
				
			||||||
		case "dirty_bytes":
 | 
							case "dirty_bytes":
 | 
				
			||||||
			vm.DirtyBytes = *vp.PInt64()
 | 
								vm.DirtyBytes = vp.PInt64()
 | 
				
			||||||
		case "dirty_expire_centisecs":
 | 
							case "dirty_expire_centisecs":
 | 
				
			||||||
			vm.DirtyExpireCentisecs = *vp.PInt64()
 | 
								vm.DirtyExpireCentisecs = vp.PInt64()
 | 
				
			||||||
		case "dirty_ratio":
 | 
							case "dirty_ratio":
 | 
				
			||||||
			vm.DirtyRatio = *vp.PInt64()
 | 
								vm.DirtyRatio = vp.PInt64()
 | 
				
			||||||
		case "dirtytime_expire_seconds":
 | 
							case "dirtytime_expire_seconds":
 | 
				
			||||||
			vm.DirtytimeExpireSeconds = *vp.PInt64()
 | 
								vm.DirtytimeExpireSeconds = vp.PInt64()
 | 
				
			||||||
		case "dirty_writeback_centisecs":
 | 
							case "dirty_writeback_centisecs":
 | 
				
			||||||
			vm.DirtyWritebackCentisecs = *vp.PInt64()
 | 
								vm.DirtyWritebackCentisecs = vp.PInt64()
 | 
				
			||||||
		case "drop_caches":
 | 
							case "drop_caches":
 | 
				
			||||||
			vm.DropCaches = *vp.PInt64()
 | 
								vm.DropCaches = vp.PInt64()
 | 
				
			||||||
		case "extfrag_threshold":
 | 
							case "extfrag_threshold":
 | 
				
			||||||
			vm.ExtfragThreshold = *vp.PInt64()
 | 
								vm.ExtfragThreshold = vp.PInt64()
 | 
				
			||||||
		case "hugetlb_shm_group":
 | 
							case "hugetlb_shm_group":
 | 
				
			||||||
			vm.HugetlbShmGroup = *vp.PInt64()
 | 
								vm.HugetlbShmGroup = vp.PInt64()
 | 
				
			||||||
		case "laptop_mode":
 | 
							case "laptop_mode":
 | 
				
			||||||
			vm.LaptopMode = *vp.PInt64()
 | 
								vm.LaptopMode = vp.PInt64()
 | 
				
			||||||
		case "legacy_va_layout":
 | 
							case "legacy_va_layout":
 | 
				
			||||||
			vm.LegacyVaLayout = *vp.PInt64()
 | 
								vm.LegacyVaLayout = vp.PInt64()
 | 
				
			||||||
		case "lowmem_reserve_ratio":
 | 
							case "lowmem_reserve_ratio":
 | 
				
			||||||
			stringSlice := strings.Fields(value)
 | 
								stringSlice := strings.Fields(value)
 | 
				
			||||||
			int64Slice := make([]int64, 0, len(stringSlice))
 | 
								pint64Slice := make([]*int64, 0, len(stringSlice))
 | 
				
			||||||
			for _, value := range stringSlice {
 | 
								for _, value := range stringSlice {
 | 
				
			||||||
				vp := util.NewValueParser(value)
 | 
									vp := util.NewValueParser(value)
 | 
				
			||||||
				int64Slice = append(int64Slice, *vp.PInt64())
 | 
									pint64Slice = append(pint64Slice, vp.PInt64())
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			vm.LowmemReserveRatio = int64Slice
 | 
								vm.LowmemReserveRatio = pint64Slice
 | 
				
			||||||
		case "max_map_count":
 | 
							case "max_map_count":
 | 
				
			||||||
			vm.MaxMapCount = *vp.PInt64()
 | 
								vm.MaxMapCount = vp.PInt64()
 | 
				
			||||||
		case "memory_failure_early_kill":
 | 
							case "memory_failure_early_kill":
 | 
				
			||||||
			vm.MemoryFailureEarlyKill = *vp.PInt64()
 | 
								vm.MemoryFailureEarlyKill = vp.PInt64()
 | 
				
			||||||
		case "memory_failure_recovery":
 | 
							case "memory_failure_recovery":
 | 
				
			||||||
			vm.MemoryFailureRecovery = *vp.PInt64()
 | 
								vm.MemoryFailureRecovery = vp.PInt64()
 | 
				
			||||||
		case "min_free_kbytes":
 | 
							case "min_free_kbytes":
 | 
				
			||||||
			vm.MinFreeKbytes = *vp.PInt64()
 | 
								vm.MinFreeKbytes = vp.PInt64()
 | 
				
			||||||
		case "min_slab_ratio":
 | 
							case "min_slab_ratio":
 | 
				
			||||||
			vm.MinSlabRatio = *vp.PInt64()
 | 
								vm.MinSlabRatio = vp.PInt64()
 | 
				
			||||||
		case "min_unmapped_ratio":
 | 
							case "min_unmapped_ratio":
 | 
				
			||||||
			vm.MinUnmappedRatio = *vp.PInt64()
 | 
								vm.MinUnmappedRatio = vp.PInt64()
 | 
				
			||||||
		case "mmap_min_addr":
 | 
							case "mmap_min_addr":
 | 
				
			||||||
			vm.MmapMinAddr = *vp.PInt64()
 | 
								vm.MmapMinAddr = vp.PInt64()
 | 
				
			||||||
		case "nr_hugepages":
 | 
							case "nr_hugepages":
 | 
				
			||||||
			vm.NrHugepages = *vp.PInt64()
 | 
								vm.NrHugepages = vp.PInt64()
 | 
				
			||||||
		case "nr_hugepages_mempolicy":
 | 
							case "nr_hugepages_mempolicy":
 | 
				
			||||||
			vm.NrHugepagesMempolicy = *vp.PInt64()
 | 
								vm.NrHugepagesMempolicy = vp.PInt64()
 | 
				
			||||||
		case "nr_overcommit_hugepages":
 | 
							case "nr_overcommit_hugepages":
 | 
				
			||||||
			vm.NrOvercommitHugepages = *vp.PInt64()
 | 
								vm.NrOvercommitHugepages = vp.PInt64()
 | 
				
			||||||
		case "numa_stat":
 | 
							case "numa_stat":
 | 
				
			||||||
			vm.NumaStat = *vp.PInt64()
 | 
								vm.NumaStat = vp.PInt64()
 | 
				
			||||||
		case "numa_zonelist_order":
 | 
							case "numa_zonelist_order":
 | 
				
			||||||
			vm.NumaZonelistOrder = value
 | 
								vm.NumaZonelistOrder = value
 | 
				
			||||||
		case "oom_dump_tasks":
 | 
							case "oom_dump_tasks":
 | 
				
			||||||
			vm.OomDumpTasks = *vp.PInt64()
 | 
								vm.OomDumpTasks = vp.PInt64()
 | 
				
			||||||
		case "oom_kill_allocating_task":
 | 
							case "oom_kill_allocating_task":
 | 
				
			||||||
			vm.OomKillAllocatingTask = *vp.PInt64()
 | 
								vm.OomKillAllocatingTask = vp.PInt64()
 | 
				
			||||||
		case "overcommit_kbytes":
 | 
							case "overcommit_kbytes":
 | 
				
			||||||
			vm.OvercommitKbytes = *vp.PInt64()
 | 
								vm.OvercommitKbytes = vp.PInt64()
 | 
				
			||||||
		case "overcommit_memory":
 | 
							case "overcommit_memory":
 | 
				
			||||||
			vm.OvercommitMemory = *vp.PInt64()
 | 
								vm.OvercommitMemory = vp.PInt64()
 | 
				
			||||||
		case "overcommit_ratio":
 | 
							case "overcommit_ratio":
 | 
				
			||||||
			vm.OvercommitRatio = *vp.PInt64()
 | 
								vm.OvercommitRatio = vp.PInt64()
 | 
				
			||||||
		case "page-cluster":
 | 
							case "page-cluster":
 | 
				
			||||||
			vm.PageCluster = *vp.PInt64()
 | 
								vm.PageCluster = vp.PInt64()
 | 
				
			||||||
		case "panic_on_oom":
 | 
							case "panic_on_oom":
 | 
				
			||||||
			vm.PanicOnOom = *vp.PInt64()
 | 
								vm.PanicOnOom = vp.PInt64()
 | 
				
			||||||
		case "percpu_pagelist_fraction":
 | 
							case "percpu_pagelist_fraction":
 | 
				
			||||||
			vm.PercpuPagelistFraction = *vp.PInt64()
 | 
								vm.PercpuPagelistFraction = vp.PInt64()
 | 
				
			||||||
		case "stat_interval":
 | 
							case "stat_interval":
 | 
				
			||||||
			vm.StatInterval = *vp.PInt64()
 | 
								vm.StatInterval = vp.PInt64()
 | 
				
			||||||
		case "swappiness":
 | 
							case "swappiness":
 | 
				
			||||||
			vm.Swappiness = *vp.PInt64()
 | 
								vm.Swappiness = vp.PInt64()
 | 
				
			||||||
		case "user_reserve_kbytes":
 | 
							case "user_reserve_kbytes":
 | 
				
			||||||
			vm.UserReserveKbytes = *vp.PInt64()
 | 
								vm.UserReserveKbytes = vp.PInt64()
 | 
				
			||||||
		case "vfs_cache_pressure":
 | 
							case "vfs_cache_pressure":
 | 
				
			||||||
			vm.VfsCachePressure = *vp.PInt64()
 | 
								vm.VfsCachePressure = vp.PInt64()
 | 
				
			||||||
		case "watermark_boost_factor":
 | 
							case "watermark_boost_factor":
 | 
				
			||||||
			vm.WatermarkBoostFactor = *vp.PInt64()
 | 
								vm.WatermarkBoostFactor = vp.PInt64()
 | 
				
			||||||
		case "watermark_scale_factor":
 | 
							case "watermark_scale_factor":
 | 
				
			||||||
			vm.WatermarkScaleFactor = *vp.PInt64()
 | 
								vm.WatermarkScaleFactor = vp.PInt64()
 | 
				
			||||||
		case "zone_reclaim_mode":
 | 
							case "zone_reclaim_mode":
 | 
				
			||||||
			vm.ZoneReclaimMode = *vp.PInt64()
 | 
								vm.ZoneReclaimMode = vp.PInt64()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if err := vp.Err(); err != nil {
 | 
							if err := vp.Err(); err != nil {
 | 
				
			||||||
			return nil, err
 | 
								return nil, err
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										200
									
								
								vendor/github.com/prometheus/procfs/xfs/parse.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										200
									
								
								vendor/github.com/prometheus/procfs/xfs/parse.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
					@ -35,23 +35,25 @@ func ParseStats(r io.Reader) (*Stats, error) {
 | 
				
			||||||
		fieldTrans       = "trans"
 | 
							fieldTrans       = "trans"
 | 
				
			||||||
		fieldIg          = "ig"
 | 
							fieldIg          = "ig"
 | 
				
			||||||
		fieldLog         = "log"
 | 
							fieldLog         = "log"
 | 
				
			||||||
 | 
							fieldPushAil     = "push_ail"
 | 
				
			||||||
 | 
							fieldXstrat      = "xstrat"
 | 
				
			||||||
		fieldRw          = "rw"
 | 
							fieldRw          = "rw"
 | 
				
			||||||
		fieldAttr        = "attr"
 | 
							fieldAttr        = "attr"
 | 
				
			||||||
		fieldIcluster    = "icluster"
 | 
							fieldIcluster    = "icluster"
 | 
				
			||||||
		fieldVnodes      = "vnodes"
 | 
							fieldVnodes      = "vnodes"
 | 
				
			||||||
		fieldBuf         = "buf"
 | 
							fieldBuf         = "buf"
 | 
				
			||||||
		fieldXpc         = "xpc"
 | 
							fieldXpc         = "xpc"
 | 
				
			||||||
 | 
							fieldAbtb2       = "abtb2"
 | 
				
			||||||
 | 
							fieldAbtc2       = "abtc2"
 | 
				
			||||||
 | 
							fieldBmbt2       = "bmbt2"
 | 
				
			||||||
 | 
							fieldIbt2        = "ibt2"
 | 
				
			||||||
 | 
							//fieldFibt2 = "fibt2"
 | 
				
			||||||
 | 
							fieldQm    = "qm"
 | 
				
			||||||
 | 
							fieldDebug = "debug"
 | 
				
			||||||
		// Unimplemented at this time due to lack of documentation.
 | 
							// Unimplemented at this time due to lack of documentation.
 | 
				
			||||||
		// fieldPushAil = "push_ail"
 | 
							//fieldRmapbt = "rmapbt"
 | 
				
			||||||
		// fieldXstrat  = "xstrat"
 | 
							//fieldRefcntbt = "refcntbt"
 | 
				
			||||||
		// fieldAbtb2   = "abtb2"
 | 
					
 | 
				
			||||||
		// fieldAbtc2   = "abtc2"
 | 
					 | 
				
			||||||
		// fieldBmbt2   = "bmbt2"
 | 
					 | 
				
			||||||
		// fieldIbt2    = "ibt2"
 | 
					 | 
				
			||||||
		// fieldFibt2   = "fibt2"
 | 
					 | 
				
			||||||
		// fieldQm      = "qm"
 | 
					 | 
				
			||||||
		// fieldDebug   = "debug"
 | 
					 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var xfss Stats
 | 
						var xfss Stats
 | 
				
			||||||
| 
						 | 
					@ -115,6 +117,23 @@ func ParseStats(r io.Reader) (*Stats, error) {
 | 
				
			||||||
			xfss.Vnode, err = vnodeStats(us)
 | 
								xfss.Vnode, err = vnodeStats(us)
 | 
				
			||||||
		case fieldBuf:
 | 
							case fieldBuf:
 | 
				
			||||||
			xfss.Buffer, err = bufferStats(us)
 | 
								xfss.Buffer, err = bufferStats(us)
 | 
				
			||||||
 | 
							case fieldPushAil:
 | 
				
			||||||
 | 
								xfss.PushAil, err = pushAilStats(us)
 | 
				
			||||||
 | 
							case fieldXstrat:
 | 
				
			||||||
 | 
								xfss.Xstrat, err = xStratStats(us)
 | 
				
			||||||
 | 
							case fieldAbtb2:
 | 
				
			||||||
 | 
								xfss.BtreeAllocBlocks2, err = btreeAllocBlocks2Stats(us)
 | 
				
			||||||
 | 
							case fieldAbtc2:
 | 
				
			||||||
 | 
								xfss.BtreeAllocContig2, err = btreeAllocContig2Stats(us)
 | 
				
			||||||
 | 
							case fieldBmbt2:
 | 
				
			||||||
 | 
								xfss.BtreeBlockMap2, err = btreeBlockMap2Stats(us)
 | 
				
			||||||
 | 
							case fieldIbt2:
 | 
				
			||||||
 | 
								xfss.BtreeInode2, err = btreeInode2Stats(us)
 | 
				
			||||||
 | 
							//case fieldFibt2:
 | 
				
			||||||
 | 
							case fieldQm:
 | 
				
			||||||
 | 
								xfss.QuotaManager, err = quotaManagerStats(us)
 | 
				
			||||||
 | 
							case fieldDebug:
 | 
				
			||||||
 | 
								xfss.Debug, err = debugStats(us)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return nil, err
 | 
								return nil, err
 | 
				
			||||||
| 
						 | 
					@ -228,7 +247,39 @@ func logOperationStats(us []uint32) (LogOperationStats, error) {
 | 
				
			||||||
	}, nil
 | 
						}, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ReadWriteStats builds a ReadWriteStats from a slice of uint32s.
 | 
					// push_ail
 | 
				
			||||||
 | 
					func pushAilStats(us []uint32) (PushAilStats, error) {
 | 
				
			||||||
 | 
						if l := len(us); l != 10 {
 | 
				
			||||||
 | 
							return PushAilStats{}, fmt.Errorf("incorrect number of values for XFS push ail stats: %d", l)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return PushAilStats{
 | 
				
			||||||
 | 
							TryLogspace:   us[0],
 | 
				
			||||||
 | 
							SleepLogspace: us[1],
 | 
				
			||||||
 | 
							Pushes:        us[2],
 | 
				
			||||||
 | 
							Success:       us[3],
 | 
				
			||||||
 | 
							PushBuf:       us[4],
 | 
				
			||||||
 | 
							Pinned:        us[5],
 | 
				
			||||||
 | 
							Locked:        us[6],
 | 
				
			||||||
 | 
							Flushing:      us[7],
 | 
				
			||||||
 | 
							Restarts:      us[8],
 | 
				
			||||||
 | 
							Flush:         us[9],
 | 
				
			||||||
 | 
						}, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// xstrat
 | 
				
			||||||
 | 
					func xStratStats(us []uint32) (XstratStats, error) {
 | 
				
			||||||
 | 
						if l := len(us); l != 2 {
 | 
				
			||||||
 | 
							return XstratStats{}, fmt.Errorf("incorrect number of values for XFS  xstrat stats: %d", l)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return XstratStats{
 | 
				
			||||||
 | 
							Quick: us[0],
 | 
				
			||||||
 | 
							Split: us[1],
 | 
				
			||||||
 | 
						}, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// rw
 | 
				
			||||||
func readWriteStats(us []uint32) (ReadWriteStats, error) {
 | 
					func readWriteStats(us []uint32) (ReadWriteStats, error) {
 | 
				
			||||||
	if l := len(us); l != 2 {
 | 
						if l := len(us); l != 2 {
 | 
				
			||||||
		return ReadWriteStats{}, fmt.Errorf("incorrect number of values for XFS read write stats: %d", l)
 | 
							return ReadWriteStats{}, fmt.Errorf("incorrect number of values for XFS read write stats: %d", l)
 | 
				
			||||||
| 
						 | 
					@ -328,3 +379,130 @@ func extendedPrecisionStats(us []uint64) (ExtendedPrecisionStats, error) {
 | 
				
			||||||
		ReadBytes:  us[2],
 | 
							ReadBytes:  us[2],
 | 
				
			||||||
	}, nil
 | 
						}, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func quotaManagerStats(us []uint32) (QuotaManagerStats, error) {
 | 
				
			||||||
 | 
						if l := len(us); l != 8 {
 | 
				
			||||||
 | 
							return QuotaManagerStats{}, fmt.Errorf("incorrect number of values for XFS quota stats: %d", l)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return QuotaManagerStats{
 | 
				
			||||||
 | 
							Reclaims:      us[0],
 | 
				
			||||||
 | 
							ReclaimMisses: us[1],
 | 
				
			||||||
 | 
							DquoteDups:    us[2],
 | 
				
			||||||
 | 
							CacheMisses:   us[3],
 | 
				
			||||||
 | 
							CacheHits:     us[4],
 | 
				
			||||||
 | 
							Wants:         us[5],
 | 
				
			||||||
 | 
							ShakeReclaims: us[6],
 | 
				
			||||||
 | 
							InactReclaims: us[7],
 | 
				
			||||||
 | 
						}, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func debugStats(us []uint32) (DebugStats, error) {
 | 
				
			||||||
 | 
						if l := len(us); l != 1 {
 | 
				
			||||||
 | 
							return DebugStats{}, fmt.Errorf("incorrect number of values for XFS debug stats: %d", l)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return DebugStats{
 | 
				
			||||||
 | 
							Enabled: us[0],
 | 
				
			||||||
 | 
						}, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// abtb2
 | 
				
			||||||
 | 
					func btreeAllocBlocks2Stats(us []uint32) (BtreeAllocBlocks2Stats, error) {
 | 
				
			||||||
 | 
						if l := len(us); l != 15 {
 | 
				
			||||||
 | 
							return BtreeAllocBlocks2Stats{}, fmt.Errorf("incorrect number of values for abtb2 stats: %d", 1)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return BtreeAllocBlocks2Stats{
 | 
				
			||||||
 | 
							Lookup:    us[0],
 | 
				
			||||||
 | 
							Compare:   us[1],
 | 
				
			||||||
 | 
							Insrec:    us[2],
 | 
				
			||||||
 | 
							Delrec:    us[3],
 | 
				
			||||||
 | 
							NewRoot:   us[4],
 | 
				
			||||||
 | 
							KillRoot:  us[5],
 | 
				
			||||||
 | 
							Increment: us[6],
 | 
				
			||||||
 | 
							Decrement: us[7],
 | 
				
			||||||
 | 
							Lshift:    us[8],
 | 
				
			||||||
 | 
							Rshift:    us[9],
 | 
				
			||||||
 | 
							Split:     us[10],
 | 
				
			||||||
 | 
							Join:      us[11],
 | 
				
			||||||
 | 
							Alloc:     us[12],
 | 
				
			||||||
 | 
							Free:      us[13],
 | 
				
			||||||
 | 
							Moves:     us[14],
 | 
				
			||||||
 | 
						}, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// abtc2
 | 
				
			||||||
 | 
					func btreeAllocContig2Stats(us []uint32) (BtreeAllocContig2Stats, error) {
 | 
				
			||||||
 | 
						if l := len(us); l != 15 {
 | 
				
			||||||
 | 
							return BtreeAllocContig2Stats{}, fmt.Errorf("incorrect number of values for abtc2 stats: %d", 1)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return BtreeAllocContig2Stats{
 | 
				
			||||||
 | 
							Lookup:    us[0],
 | 
				
			||||||
 | 
							Compare:   us[1],
 | 
				
			||||||
 | 
							Insrec:    us[2],
 | 
				
			||||||
 | 
							Delrec:    us[3],
 | 
				
			||||||
 | 
							NewRoot:   us[4],
 | 
				
			||||||
 | 
							KillRoot:  us[5],
 | 
				
			||||||
 | 
							Increment: us[6],
 | 
				
			||||||
 | 
							Decrement: us[7],
 | 
				
			||||||
 | 
							Lshift:    us[8],
 | 
				
			||||||
 | 
							Rshift:    us[9],
 | 
				
			||||||
 | 
							Split:     us[10],
 | 
				
			||||||
 | 
							Join:      us[11],
 | 
				
			||||||
 | 
							Alloc:     us[12],
 | 
				
			||||||
 | 
							Free:      us[13],
 | 
				
			||||||
 | 
							Moves:     us[14],
 | 
				
			||||||
 | 
						}, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// bmbt2
 | 
				
			||||||
 | 
					func btreeBlockMap2Stats(us []uint32) (BtreeBlockMap2Stats, error) {
 | 
				
			||||||
 | 
						if l := len(us); l != 15 {
 | 
				
			||||||
 | 
							return BtreeBlockMap2Stats{}, fmt.Errorf("incorrect number of values for bmbt2 stats: %d", 1)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return BtreeBlockMap2Stats{
 | 
				
			||||||
 | 
							Lookup:    us[0],
 | 
				
			||||||
 | 
							Compare:   us[1],
 | 
				
			||||||
 | 
							Insrec:    us[2],
 | 
				
			||||||
 | 
							Delrec:    us[3],
 | 
				
			||||||
 | 
							NewRoot:   us[4],
 | 
				
			||||||
 | 
							KillRoot:  us[5],
 | 
				
			||||||
 | 
							Increment: us[6],
 | 
				
			||||||
 | 
							Decrement: us[7],
 | 
				
			||||||
 | 
							Lshift:    us[8],
 | 
				
			||||||
 | 
							Rshift:    us[9],
 | 
				
			||||||
 | 
							Split:     us[10],
 | 
				
			||||||
 | 
							Join:      us[11],
 | 
				
			||||||
 | 
							Alloc:     us[12],
 | 
				
			||||||
 | 
							Free:      us[13],
 | 
				
			||||||
 | 
							Moves:     us[14],
 | 
				
			||||||
 | 
						}, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ibt2
 | 
				
			||||||
 | 
					func btreeInode2Stats(us []uint32) (BtreeInode2Stats, error) {
 | 
				
			||||||
 | 
						if l := len(us); l != 15 {
 | 
				
			||||||
 | 
							return BtreeInode2Stats{}, fmt.Errorf("incorrect number of values for ibt2 stats: %d", 1)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return BtreeInode2Stats{
 | 
				
			||||||
 | 
							Lookup:    us[0],
 | 
				
			||||||
 | 
							Compare:   us[1],
 | 
				
			||||||
 | 
							Insrec:    us[2],
 | 
				
			||||||
 | 
							Delrec:    us[3],
 | 
				
			||||||
 | 
							NewRoot:   us[4],
 | 
				
			||||||
 | 
							KillRoot:  us[5],
 | 
				
			||||||
 | 
							Increment: us[6],
 | 
				
			||||||
 | 
							Decrement: us[7],
 | 
				
			||||||
 | 
							Lshift:    us[8],
 | 
				
			||||||
 | 
							Rshift:    us[9],
 | 
				
			||||||
 | 
							Split:     us[10],
 | 
				
			||||||
 | 
							Join:      us[11],
 | 
				
			||||||
 | 
							Alloc:     us[12],
 | 
				
			||||||
 | 
							Free:      us[13],
 | 
				
			||||||
 | 
							Moves:     us[14],
 | 
				
			||||||
 | 
						}, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										121
									
								
								vendor/github.com/prometheus/procfs/xfs/xfs.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										121
									
								
								vendor/github.com/prometheus/procfs/xfs/xfs.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
					@ -49,6 +49,14 @@ type Stats struct {
 | 
				
			||||||
	Vnode              VnodeStats
 | 
						Vnode              VnodeStats
 | 
				
			||||||
	Buffer             BufferStats
 | 
						Buffer             BufferStats
 | 
				
			||||||
	ExtendedPrecision  ExtendedPrecisionStats
 | 
						ExtendedPrecision  ExtendedPrecisionStats
 | 
				
			||||||
 | 
						Xstrat             XstratStats            // xstrat
 | 
				
			||||||
 | 
						PushAil            PushAilStats           // push_ail
 | 
				
			||||||
 | 
						Debug              DebugStats             // debug
 | 
				
			||||||
 | 
						QuotaManager       QuotaManagerStats      // qm
 | 
				
			||||||
 | 
						BtreeAllocBlocks2  BtreeAllocBlocks2Stats // abtb2
 | 
				
			||||||
 | 
						BtreeAllocContig2  BtreeAllocContig2Stats // abtc2
 | 
				
			||||||
 | 
						BtreeBlockMap2     BtreeBlockMap2Stats    // bmbt2
 | 
				
			||||||
 | 
						BtreeInode2        BtreeInode2Stats       // ibt2
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ExtentAllocationStats contains statistics regarding XFS extent allocations.
 | 
					// ExtentAllocationStats contains statistics regarding XFS extent allocations.
 | 
				
			||||||
| 
						 | 
					@ -170,6 +178,119 @@ type ExtendedPrecisionStats struct {
 | 
				
			||||||
	ReadBytes  uint64
 | 
						ReadBytes  uint64
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// PushAilStats contains statistics on tail-pushing operations.
 | 
				
			||||||
 | 
					type PushAilStats struct {
 | 
				
			||||||
 | 
						TryLogspace   uint32
 | 
				
			||||||
 | 
						SleepLogspace uint32
 | 
				
			||||||
 | 
						Pushes        uint32
 | 
				
			||||||
 | 
						Success       uint32
 | 
				
			||||||
 | 
						PushBuf       uint32
 | 
				
			||||||
 | 
						Pinned        uint32
 | 
				
			||||||
 | 
						Locked        uint32
 | 
				
			||||||
 | 
						Flushing      uint32
 | 
				
			||||||
 | 
						Restarts      uint32
 | 
				
			||||||
 | 
						Flush         uint32
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// QuotaManagerStats contain statistics regarding quota processing.
 | 
				
			||||||
 | 
					type QuotaManagerStats struct {
 | 
				
			||||||
 | 
						Reclaims      uint32
 | 
				
			||||||
 | 
						ReclaimMisses uint32
 | 
				
			||||||
 | 
						DquoteDups    uint32
 | 
				
			||||||
 | 
						CacheMisses   uint32
 | 
				
			||||||
 | 
						CacheHits     uint32
 | 
				
			||||||
 | 
						Wants         uint32
 | 
				
			||||||
 | 
						ShakeReclaims uint32
 | 
				
			||||||
 | 
						InactReclaims uint32
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// XstratStats contains statistics regarding bytes processed by the XFS daemon.
 | 
				
			||||||
 | 
					type XstratStats struct {
 | 
				
			||||||
 | 
						Quick uint32
 | 
				
			||||||
 | 
						Split uint32
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// DebugStats indicate if XFS debugging is enabled.
 | 
				
			||||||
 | 
					type DebugStats struct {
 | 
				
			||||||
 | 
						Enabled uint32
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// BtreeAllocBlocks2Stats contains statistics on B-Tree v2 allocations.
 | 
				
			||||||
 | 
					type BtreeAllocBlocks2Stats struct {
 | 
				
			||||||
 | 
						Lookup    uint32
 | 
				
			||||||
 | 
						Compare   uint32
 | 
				
			||||||
 | 
						Insrec    uint32
 | 
				
			||||||
 | 
						Delrec    uint32
 | 
				
			||||||
 | 
						NewRoot   uint32
 | 
				
			||||||
 | 
						KillRoot  uint32
 | 
				
			||||||
 | 
						Increment uint32
 | 
				
			||||||
 | 
						Decrement uint32
 | 
				
			||||||
 | 
						Lshift    uint32
 | 
				
			||||||
 | 
						Rshift    uint32
 | 
				
			||||||
 | 
						Split     uint32
 | 
				
			||||||
 | 
						Join      uint32
 | 
				
			||||||
 | 
						Alloc     uint32
 | 
				
			||||||
 | 
						Free      uint32
 | 
				
			||||||
 | 
						Moves     uint32
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// BtreeAllocContig2Stats contain statistics on B-tree v2 free-space-by-size record operations.
 | 
				
			||||||
 | 
					type BtreeAllocContig2Stats struct {
 | 
				
			||||||
 | 
						Lookup    uint32
 | 
				
			||||||
 | 
						Compare   uint32
 | 
				
			||||||
 | 
						Insrec    uint32
 | 
				
			||||||
 | 
						Delrec    uint32
 | 
				
			||||||
 | 
						NewRoot   uint32
 | 
				
			||||||
 | 
						KillRoot  uint32
 | 
				
			||||||
 | 
						Increment uint32
 | 
				
			||||||
 | 
						Decrement uint32
 | 
				
			||||||
 | 
						Lshift    uint32
 | 
				
			||||||
 | 
						Rshift    uint32
 | 
				
			||||||
 | 
						Split     uint32
 | 
				
			||||||
 | 
						Join      uint32
 | 
				
			||||||
 | 
						Alloc     uint32
 | 
				
			||||||
 | 
						Free      uint32
 | 
				
			||||||
 | 
						Moves     uint32
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// BtreeBlockMap2Stats contain statistics on B-tree v2 block map operations.
 | 
				
			||||||
 | 
					type BtreeBlockMap2Stats struct {
 | 
				
			||||||
 | 
						Lookup    uint32
 | 
				
			||||||
 | 
						Compare   uint32
 | 
				
			||||||
 | 
						Insrec    uint32
 | 
				
			||||||
 | 
						Delrec    uint32
 | 
				
			||||||
 | 
						NewRoot   uint32
 | 
				
			||||||
 | 
						KillRoot  uint32
 | 
				
			||||||
 | 
						Increment uint32
 | 
				
			||||||
 | 
						Decrement uint32
 | 
				
			||||||
 | 
						Lshift    uint32
 | 
				
			||||||
 | 
						Rshift    uint32
 | 
				
			||||||
 | 
						Split     uint32
 | 
				
			||||||
 | 
						Join      uint32
 | 
				
			||||||
 | 
						Alloc     uint32
 | 
				
			||||||
 | 
						Free      uint32
 | 
				
			||||||
 | 
						Moves     uint32
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// BtreeInode2Stats contain statistics on B-tree v2 inode allocations.
 | 
				
			||||||
 | 
					type BtreeInode2Stats struct {
 | 
				
			||||||
 | 
						Lookup    uint32
 | 
				
			||||||
 | 
						Compare   uint32
 | 
				
			||||||
 | 
						Insrec    uint32
 | 
				
			||||||
 | 
						Delrec    uint32
 | 
				
			||||||
 | 
						NewRoot   uint32
 | 
				
			||||||
 | 
						KillRoot  uint32
 | 
				
			||||||
 | 
						Increment uint32
 | 
				
			||||||
 | 
						Decrement uint32
 | 
				
			||||||
 | 
						Lshift    uint32
 | 
				
			||||||
 | 
						Rshift    uint32
 | 
				
			||||||
 | 
						Split     uint32
 | 
				
			||||||
 | 
						Join      uint32
 | 
				
			||||||
 | 
						Alloc     uint32
 | 
				
			||||||
 | 
						Free      uint32
 | 
				
			||||||
 | 
						Moves     uint32
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FS represents the pseudo-filesystems proc and sys, which provides an interface to
 | 
					// FS represents the pseudo-filesystems proc and sys, which provides an interface to
 | 
				
			||||||
// kernel data structures.
 | 
					// kernel data structures.
 | 
				
			||||||
type FS struct {
 | 
					type FS struct {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -45,7 +45,7 @@ github.com/prometheus/common/version
 | 
				
			||||||
github.com/prometheus/common/expfmt
 | 
					github.com/prometheus/common/expfmt
 | 
				
			||||||
github.com/prometheus/common/model
 | 
					github.com/prometheus/common/model
 | 
				
			||||||
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
 | 
					github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
 | 
				
			||||||
# github.com/prometheus/procfs v0.0.4-0.20190731153504-5da962fa40f1
 | 
					# github.com/prometheus/procfs v0.0.4
 | 
				
			||||||
github.com/prometheus/procfs
 | 
					github.com/prometheus/procfs
 | 
				
			||||||
github.com/prometheus/procfs/bcache
 | 
					github.com/prometheus/procfs/bcache
 | 
				
			||||||
github.com/prometheus/procfs/nfs
 | 
					github.com/prometheus/procfs/nfs
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue