Documentation
¶
Index ¶
Constants ¶
const NetworkSource = "network"
NetworkSource names the external network readings in resource availability.
Variables ¶
This section is empty.
Functions ¶
func ReadIO ¶
ReadIO reads a cgroup's bytes read from and written to block devices since it was created: io.stat's rbytes and wbytes, summed over devices.
Types ¶
type BKNetworkSampler ¶
type BKNetworkSampler interface {
Sample() (*resourcestypes.NetworkSample, error)
}
type CommandSampler ¶
type CommandSampler struct {
// contains filtered or unexported fields
}
CommandSampler uses the same CPU and memory metrics as withExec, without requiring a network namespace or an eBPF network sampler.
func NewCommandSampler ¶
type ExecStats ¶
type ExecStats struct {
MinorFaults int64
MajorFaults int64
HugeFaults int64
CPUStallUS int64
MemStallUS int64
}
ExecStats is what a cgroup counted over its life, for a reading taken once its work is done: its page faults from memory.stat (minor, major, and those that allocated a transparent huge page), and the time any of its tasks stalled for CPU and for memory (the "some" totals of cpu.pressure and memory.pressure, 0 when the kernel doesn't report pressure).
func ReadExecStats ¶
ReadExecStats reads a cgroup's ExecStats.
type Memory ¶
Memory is a cgroup's memory at one moment, from memory.stat: anonymous memory, file pages (the page cache), and the part of both in transparent huge pages.
func ReadMemory ¶
ReadMemory reads a cgroup's current memory.
type Sampler ¶
type Sampler struct {
// contains filtered or unexported fields
}
func NewSampler ¶
func (*Sampler) DisableCgroupSamples ¶
func (s *Sampler) DisableCgroupSamples()
Do not present container-only usage as an inclusive exec total if a mount helper could not join the execution's cgroup.
func (*Sampler) SampleOther ¶
SampleOther reads every sampler not read by SampleUsage.
func (*Sampler) SampleUsage ¶
SampleUsage reads total CPU and current memory, the readings workload export copies.
func (*Sampler) SetMountNetwork ¶
func (s *Sampler) SetMountNetwork(mounts BKNetworkSampler)
Mount counters start at zero for this exec; unlike a pooled veth, they must not be baselined after mount setup has already transferred data.