package cpustats
import "github.com/hashicorp/nomad/client/lib/cpustats"
Package cpustats provides utilities for tracking CPU usage statistics.
Index ¶
Types ¶
type Compute ¶
Compute is the cpu related fields of a numa.Topology needed for computing performance / utilization of tasks.
Note that this is serialized and passed to executor.Executor as a CLI argument and so we use small json field names to minimize ps spam.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
A Tracker keeps track of one aspect of CPU utilization (i.e. one of system, user, or total time).
func New ¶
New creates a fresh Tracker with no data.
func (*Tracker) Percent ¶
Percent calculates the CPU usage percentage based on the current CPU usage and the previous CPU usage where usage is given as a time in nanoseconds spent using the CPU.
func (*Tracker) TicksConsumed ¶
TicksConsumed calculates the total bandwidth consumed by the process across all system CPU cores (not just the ones available to Nomad or this particular process.
Source Files ¶
- Version
- v1.10.0 (latest)
- Published
- Apr 9, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 2 days ago –
Tools for package owners.