resources

package
v1.0.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func NewCommandSampler(cgroupPath string, meter metric.Meter, attrs attribute.Set) (*CommandSampler, error)

func (*CommandSampler) Sample

func (s *CommandSampler) Sample(ctx context.Context) error

Sample must run before the command's cgroup is removed, including after exit so short-lived commands retain their final CPU usage and memory peak.

type Sampler

type Sampler struct {
	// contains filtered or unexported fields
}

func NewSampler

func NewSampler(
	cgroupNSSubpath string,
	netNS BKNetworkSampler,
	meter metric.Meter,
	commonAttrs attribute.Set,
) (*Sampler, error)

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) Sample

func (s *Sampler) Sample(ctx context.Context) error

func (*Sampler) SampleOther

func (s *Sampler) SampleOther(ctx context.Context) error

SampleOther reads every sampler not read by SampleUsage.

func (*Sampler) SampleUsage

func (s *Sampler) SampleUsage(ctx context.Context) error

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.

Jump to

Keyboard shortcuts

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