cpuinfo

package
v0.0.0-...-df36a95 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cpuinfo handles processing of /proc/cpuinfo. The Info struct will have one entry per processor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

type CPU struct {
	Processor       int32    `json:"processor"`
	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"`
	CacheSize       string   `json:"cache_size"`
	PhysicalID      int32    `json:"physical_id"`
	Siblings        int8     `json:"siblings"`
	CoreID          int32    `json:"core_id"`
	CPUCores        int32    `json:"cpu_cores"`
	APICID          int32    `json:"apicid"`
	InitialAPICID   int32    `json:"initial_apicid"`
	FPU             string   `json:"fpu"`
	FPUException    string   `json:"fpu_exception"`
	CPUIDLevel      string   `json:"cpuid_level"`
	WP              string   `json:"wp"`
	Flags           []string `json:"flags"`
	BogoMIPS        float32  `json:"bogomips"`
	Bugs            []string `json:"bugs"`
	CLFlushSize     uint16   `json:"clflush_size"`
	CacheAlignment  uint16   `json:"cache_alignment"`
	AddressSizes    []string `json:"address_sizes"`
	PowerManagement []string `json:"power_management"`
	TLBSize         string   `json:"tlb_size"`
}

CPU holds the /proc/cpuinfo for a single processor.

type CPUInfo

type CPUInfo struct {
	Timestamp int64
	Sockets   int32
	CPU       []CPU `json:"cpus"`
}

CPUInfo holds information about the system's cpus; CPU will have one entry per processor.

func Get

func Get() (inf *CPUInfo, err error)

Get returns the current cpuinfo using the package's global Profiler.

type Profiler

type Profiler struct {
	joe.Procer
	*joe.Buffer
}

Profiler is used to process the /proc/cpuinfo file.

func NewProfiler

func NewProfiler() (prof *Profiler, err error)

Returns an initialized Profiler; ready to use.

func (*Profiler) Get

func (prof *Profiler) Get() (inf *CPUInfo, err error)

Get returns the current cpuinfo.

func (*Profiler) Reset

func (prof *Profiler) Reset() error

Reset resources; after reset the profiler is ready to be used again.

Directories

Path Synopsis
Package cpuinfo (flat) handles Flatbuffer based processing of /proc/cpuinfo.
Package cpuinfo (flat) handles Flatbuffer based processing of /proc/cpuinfo.
Package cpuinfo (json) handles JSON based processing of /proc/cpuinfo.
Package cpuinfo (json) handles JSON based processing of /proc/cpuinfo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL