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. Instead of returning a Go struct, Flatbuffer serialized bytes are returned. A function to deserialize the Flatbuffer serialized bytes into a processors.Processors struct is provided.
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.
Note: the package name is processors and not the final element of the import path (flat).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
func Deserialize(p []byte) *processors.Processors
Deserialize takes some Flatbuffer serialized bytes and deserializes them as processors.Processors.
func Get ¶
Get returns the current processor info as Flatbuffer serialized bytes using the package's global Profiler.
func Serialize ¶
func Serialize(proc *processors.Processors) (p []byte, err error)
Serialize processors information.
Types ¶
type Profiler ¶
type Profiler struct { *processors.Profiler *fb.Builder }
Profiler is used to get the processor information, as Flatbuffers serialized bytes, by processing the /proc/cpuinfo file.
func NewProfiler ¶
Returns an initialized Profiler; ready to use.
func (*Profiler) Serialize ¶
func (p *Profiler) Serialize(procs *processors.Processors) []byte
Serialize serializes Processors using Flatbuffers.
func (*Profiler) SerializeCache ¶
SerializeCache serializes a cache entry using flatbuffers and returns the resulting UOffsetT.