cpu

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 13 Imported by: 0

README

devices-cpu

Processor information for the devices-* family: identity and specs as static values, usage, clocks, and temperatures as dynamic ones. Windows + Linux, no cgo required.

basic detailed full
static model, vendor, arch, core counts, base clock caches, family/model/stepping, boost clock, notable features full feature flags, microcode, cache line
dynamic total + per-core usage package temp, per-core clocks (Linux), load averages (Linux) per-core temps (Linux)

Sources: cpuid (CPUID instruction, works unprivileged everywhere), gopsutil (usage, load), cpufreq sysfs and hwmon on Linux, ACPI thermal zones via WMI on Windows. Unreadable values are reported as gaps with reasons.

$ devices-cpu                        # one snapshot
$ devices-cpu --level full --json    # everything, as JSON
$ devices-cpu --every 0.25           # four samples a second
$ devices-cpu --tui                  # live dashboard (snap/tui-base)
$ devices-cpu --web :8080            # JSON + SSE API and <jf-devices> web component

Library use, streaming, TUI embedding, and the web component are documented in devices-common.

MIT — see LICENSE.

Documentation

Overview

Package cpu reports processor information for the jarvisfriends devices-* family: identity and specs as static values, usage, clocks, and temperatures as dynamic ones. Everything works without cgo on Windows and Linux; values a platform cannot produce are reported as gaps with reasons.

Sources, in preference order: the CPUID instruction via github.com/klauspost/cpuid (identity, topology, caches, features — works unprivileged everywhere), gopsutil (usage percentages, load, reported clock), sysfs cpufreq on Linux and ACPI thermal zones via WMI on Windows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector implements devices.Collector for the CPU category.

func New

func New() *Collector

New builds the CPU collector.

func (*Collector) Category

func (*Collector) Category() string

Category satisfies devices.Collector.

func (*Collector) Dynamic

func (c *Collector) Dynamic(ctx context.Context, level devices.Level) (devices.Snapshot, error)

Dynamic satisfies devices.Collector.

func (*Collector) Static

func (c *Collector) Static(ctx context.Context, level devices.Level) (devices.Snapshot, error)

Static satisfies devices.Collector.

Directories

Path Synopsis
cmd
devices-cpu command
Command devices-cpu reports processor specs and live readings using the shared devices-common CLI: one-shot, --json, --every 0.25, --tui, --web.
Command devices-cpu reports processor specs and live readings using the shared devices-common CLI: one-shot, --json, --every 0.25, --tui, --web.

Jump to

Keyboard shortcuts

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