cpuinfo

package
v0.0.0-...-c5429dd Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.

SPDX-License-Identifier: GPL-3.0-or-later

Index

Constants

View Source
const (
	FilePath = "/proc/cpuinfo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUInfo

type CPUInfo struct {
	Processors []Processor `json:"processors"`
	Hardware   string
}

func ReadCPUInfo

func ReadCPUInfo(path string) (*CPUInfo, error)

func (*CPUInfo) NumCPU

func (c *CPUInfo) NumCPU() int

func (*CPUInfo) NumCore

func (c *CPUInfo) NumCore() int

func (*CPUInfo) NumPhysicalCPU

func (c *CPUInfo) NumPhysicalCPU() int

type Processor

type Processor struct {
	Id         int64    `json:"id"`
	VendorId   string   `json:"vendor_id"`
	Model      int64    `json:"model"`
	ModelName  string   `json:"model_name"`
	Flags      []string `json:"flags"`
	Cores      int64    `json:"cores"`
	MHz        float64  `json:"mhz"`
	CacheSize  int64    `json:"cache_size"` // KB
	PhysicalId int64    `json:"physical_id"`
	CoreId     int64    `json:"core_id"`
}

Jump to

Keyboard shortcuts

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