Documentation ¶
Overview ¶
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs. This package gathers basic information about sockets, physical processors, etc. on the system. For multi-socket systems, it is assumed that all of the processors are the same.
CPUMHz currently provides the current speed of the first core encountered for each physical processor. Modern x86/x86-64 cores have the ability to shift their speed so this is just a point in time data point for that core; there may be other cores on the processor that are at higher and lower speeds at the time the data is read. This field is more useful for other architectures. For x86/x86-64 cores, the MHzMin and MHzMax fields provide information about the range of speeds that are possible for the cores.
Index ¶
Constants ¶
const ( BigEndian = "Big Endian" LittleEndian = "Little Endian" VTx = "VT-x" AMDV = "AMD-V" )
Variables ¶
This section is empty.
Functions ¶
func Endianness ¶
func Endianness() string
Endianness returns the endianness. Code from Rob Pike's response in thread about endianness detection:
https://groups.google.com/d/msg/golang-nuts/zmh64YkqOV8/iJe-TrTTeREJ
Types ¶
type Processors ¶
type Processors struct { Timestamp int64 `json:"timestamp"` Architecture string `json:"architecture"` ByteOrder string `json:"byte_order"` Sockets int32 `json:"sockets"` CPUs int32 `json:"cpus"` Possible string `json:"possible"` Present string `json:"present"` Offline string `json:"offline"` Online string `json:"online"` CoresPerSocket int16 `json:"cores_per_socket"` ThreadsPerCore int8 `json:"threads_per_core"` VendorID string `json:"vendor_id"` CPUFamily string `json:"cpu_family"` Model string `json:"model"` ModelName string `json:"model_name"` Stepping string `json:"stepping"` Microcode string `json:"microcode"` CPUMHz float32 `json:"cpu_mhz"` MHzMin float32 `json:"mhz_min"` MHzMax float32 `json:"mhz_max"` CacheSize string `json:"cache_size"` Cache map[string]string `json:"cache"` CacheIDs []string `json:"cache_ids"` BogoMIPS float32 `json:"bogomips"` Flags []string `json:"flags"` Bugs []string `json:"bugs"` OpModes []string `json:"op_modes"` Virtualization string `json:"virtualization"` NumaNodes int32 `json:"numa_nodes"` NumaNodeCPUs []node.Node `json:"numa_node_cpus"` }
Processors holds information about a system's processors
func Get ¶
func Get() (procs *Processors, err error)
Get returns the information about the processors using the package's global Profiler.
func New ¶
func New() *Processors
This returns a *Processor ready to use. If a Processors struct isn't created using the New func, the ByteOrder field will not be set.
type Profiler ¶
type Profiler struct { joe.Procer *joe.Buffer CPUProf *cpux.Profiler // This is created with the profiler for testing purposes. NodeProf *node.Profiler // This is created with the profiler for testing purposes. }
Profiler is used to get the processor information by processing the /proc/cpuinfo file.
func NewProfiler ¶
Returns an initialized Profiler; ready to use.
func (*Profiler) Get ¶
func (prof *Profiler) Get() (procs *Processors, err error)
Get returns the processor information.
Directories ¶
Path | Synopsis |
---|---|
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs.
|
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs. |
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs.
|
Package processors gathers information about the physical processors on a system by parsing the information from /procs/cpuinfo and the sysfs. |