hostcap

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Shared (non OS-specific) helper for locating the filesystem whose capacity the agent reports as the host's tenant-data disk. The per-OS DetectDisk functions statfs this path. British English. No em dashes.

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.

func DetectDisk added in v0.1.24

func DetectDisk() (totalGb, freeGb int)

DetectDisk returns the total and available space (GB) of the tenant-data filesystem (see dataDir). Either is 0 on a statfs miss, which the caller omits so it never overwrites a known value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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