hardware

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MemoryFromProto

func MemoryFromProto(m *sonm.RAMDevice) (*mem.VirtualMemoryStat, error)

func MemoryIntoProto

func MemoryIntoProto(m *mem.VirtualMemoryStat) *sonm.RAMDevice

Types

type Hardware

type Hardware struct {
	CPU    []cpu.Device
	Memory *mem.VirtualMemoryStat
	GPU    []gpu.Device
}

Hardware accumulates the finest hardware information about system the miner is running on.

func HardwareFromProto

func HardwareFromProto(cap *sonm.Capabilities) (*Hardware, error)

func (*Hardware) HasGPU

func (h *Hardware) HasGPU() bool

HasGPU returns true if a system has GPU on the board.

func (*Hardware) IntoProto

func (h *Hardware) IntoProto() *sonm.Capabilities

func (*Hardware) LogicalCPUCount

func (h *Hardware) LogicalCPUCount() int

LogicalCPUCount returns the number of logical CPUs in the system.

func (*Hardware) TotalMemory

func (h *Hardware) TotalMemory() uint64

TotalMemory returns the total number of bytes.

type HardwareInfo

type HardwareInfo interface {
	// CPU returns information about system CPU.
	//
	// This includes vendor name, model name, number of cores, cache info,
	// instruction flags and many others to be able to identify and to properly
	// account the CPU.
	CPU() ([]cpu.Device, error)

	// Memory returns information about system memory.
	//
	// This includes total physical  memory, available memory and many others,
	// expressed in bytes.
	Memory() (*mem.VirtualMemoryStat, error)

	// GPU returns information about GPU devices on the machine.
	GPU() ([]gpu.Device, error)

	// Info returns all described above hardware statistics.
	Info() (*Hardware, error)
}

func New

func New() HardwareInfo

New constructs a new hardware info collector.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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