hostcap

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package hostcap detects the physical box's capacity (CPU cores and total RAM) from the host's /proc, so the agent can report it to the control plane on every heartbeat. It reports HOST values, not the container's cgroup limits, so a resized VPS is reflected automatically.

Every read is defensive: a failure yields 0 for that field rather than an error, so a detection miss can never sink a status report. The control plane treats 0 as "no change" and never overwrites a known-good value with it.

British English throughout. No em dashes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect() (cpuCores float64, totalRamMb int)

Detect returns the host's CPU core count and total RAM in MB. Either may be 0 when it cannot be read; the caller omits a zero field from the report.

Types

This section is empty.

Jump to

Keyboard shortcuts

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