Documentation
¶
Overview ¶
Package usage observes a captured process group. It never grants process control authority and never reads command lines or process environments.
Index ¶
- Constants
- func CPUClockQuantum() (uint64, string, error)
- func Capture(pid int) (model.ProcessIdentity, error)
- func CaptureCPUAnchor(root model.ProcessIdentity) (string, error)
- func ListPIDs(limit int) ([]int, error)
- func View(current Snapshot, previous *Snapshot) model.WorkloadUsage
- type CPUCut
- type CPUOwner
- type CPUOwnerDelta
- type CPUProcessCounter
- type CPUProcessDelta
- type Sample
- type Snapshot
Constants ¶
const CPUCutBudget = 100 * time.Millisecond
const CPUOwnerLimit = 32
const CPUProcessLimit = 256
const CPUUnitDarwinMach = "darwin-recount-mach"
const MaxMembers = 256
Variables ¶
This section is empty.
Functions ¶
func CPUClockQuantum ¶
func CaptureCPUAnchor ¶
func CaptureCPUAnchor(root model.ProcessIdentity) (string, error)
Types ¶
type CPUCut ¶
type CPUCut struct {
Started, Finished time.Time
Method, Detail string
Members []CPUProcessCounter
// contains filtered or unexported fields
}
func CollectCPU ¶
CollectCPU performs CPU-only native reads. Inventory can be partial: only members with a complete verified ancestry chain are retained, and later matching credits only members present in both contained cuts.
type CPUOwner ¶
type CPUOwner struct {
Token string
Root model.ProcessIdentity
Cookie string
}
CPUOwner is supplied only from an original live supervised job. Cookie is captured while its launch gate is closed, before the original Wait can reap that process. Neither a saved PID nor a process group establishes ownership.
type CPUOwnerDelta ¶
type CPUOwnerDelta struct {
Owner CPUOwner
User, System uint64
MatchedProcesses int
Members []CPUProcessDelta
}
func ContainedCPUDeltas ¶
func ContainedCPUDeltas(previous, current CPUCut) []CPUOwnerDelta
ContainedCPUDeltas returns raw, identity-verified matched-member deltas. The caller must separately establish that these cuts lie inside its host-counter interval and that the native units have a proved accounting relationship.
type CPUProcessCounter ¶
type CPUProcessDelta ¶
type Sample ¶
type Sample struct {
Identity model.ProcessIdentity
PPID int
Name string
Stopped bool // stopped by a signal or tracer
CPUSeconds *float64
Resident *uint64
Footprint *uint64 // Darwin physical footprint; nil elsewhere
DiskRead *uint64 // cumulative storage bytes, when the platform permits
DiskWrite *uint64
}
Sample is one process observation for host-wide inventory. It carries no control authority; callers must revalidate Identity before any action.