Documentation
¶
Overview ¶
Package cputime is the single seam through which rule code runs work off its calling thread while retaining per-rule CPU attribution.
Index ¶
Constants ¶
const Supported = true
Variables ¶
This section is empty.
Functions ¶
func CombinedOutput ¶
CombinedOutput runs cmd and charges the child's user and system CPU whenever it started, including when it returned an *exec.ExitError.
func Go ¶
Go runs fn on a new goroutine and charges its thread CPU to m before sending fn's result. A nil meter is a programming error.
func Process ¶
Process reads user and system CPU for this process and children it waited for, so waited-for descendants are included exactly once.
Types ¶
type Meter ¶
type Meter struct {
// contains filtered or unexported fields
}
Meter accumulates user and system CPU consumed by goroutines and child processes started by one rule. Its zero value is ready for concurrent use.
func (*Meter) OffThreadCPU ¶
OffThreadCPU returns CPU charged by metered goroutines and child processes.