cgroups: github.com/containerd/cgroups Index | Files

package cgroups

import "github.com/containerd/cgroups"

Package cgroups is a generated protocol buffer package.

It is generated from these files:

github.com/containerd/cgroups/metrics.proto

It has these top-level messages:

Metrics
HugetlbStat
PidsStat
CPUStat
CPUUsage
Throttle
MemoryStat
MemoryEntry
BlkIOStat
BlkIOEntry
RdmaStat
RdmaEntry
NetworkStat

Index

Package Files

blkio.go cgroup.go control.go cpu.go cpuacct.go cpuset.go devices.go errors.go freezer.go hierarchy.go hugetlb.go memory.go metrics.pb.go named.go net_cls.go net_prio.go opts.go paths.go perf_event.go pids.go rdma.go state.go subsystem.go systemd.go ticks.go utils.go v1.go

Variables

var (
    ErrInvalidPid               = errors.New("cgroups: pid must be greater than 0")
    ErrMountPointNotExist       = errors.New("cgroups: cgroup mountpoint does not exist")
    ErrInvalidFormat            = errors.New("cgroups: parsing file with invalid format failed")
    ErrFreezerNotSupported      = errors.New("cgroups: freezer cgroup not supported on this system")
    ErrMemoryNotSupported       = errors.New("cgroups: memory cgroup not supported on this system")
    ErrCgroupDeleted            = errors.New("cgroups: cgroup deleted")
    ErrNoCgroupMountDestination = errors.New("cgroups: cannot find cgroup mount destination")
)
var (
    ErrInvalidLengthMetrics = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowMetrics   = fmt.Errorf("proto: integer overflow")
)
var (
    // ErrIgnoreSubsystem allows the specific subsystem to be skipped
    ErrIgnoreSubsystem = errors.New("skip subsystem")
    // ErrDevicesRequired is returned when the devices subsystem is required but
    // does not exist or is not active
    ErrDevicesRequired = errors.New("devices subsystem is required")
)
var ErrControllerNotActive = errors.New("controller is not supported")

ErrControllerNotActive is returned when a controller is not supported or enabled

func AllowAny Uses

func AllowAny(s Subsystem, p Path, err error) error

AllowAny allows any subsystem errors to be skipped

func IgnoreNotExist Uses

func IgnoreNotExist(err error) error

IgnoreNotExist ignores any errors that are for not existing files

func NewBlkio Uses

func NewBlkio(root string) *blkioController

func NewCpu Uses

func NewCpu(root string) *cpuController

func NewCpuacct Uses

func NewCpuacct(root string) *cpuacctController

func NewCputset Uses

func NewCputset(root string) *cpusetController

func NewDevices Uses

func NewDevices(root string) *devicesController

func NewFreezer Uses

func NewFreezer(root string) *freezerController

func NewHugetlb Uses

func NewHugetlb(root string) (*hugetlbController, error)

func NewMemory Uses

func NewMemory(root string) *memoryController

func NewNamed Uses

func NewNamed(root string, name Name) *namedController

func NewNetCls Uses

func NewNetCls(root string) *netclsController

func NewNetPrio Uses

func NewNetPrio(root string) *netprioController

func NewPids Uses

func NewPids(root string) *pidsController

func NewRdma Uses

func NewRdma(root string) *rdmaController

func RequireDevices Uses

func RequireDevices(s Subsystem, p Path, err error) error

RequireDevices requires the device subsystem but no others

func RootPath Uses

func RootPath(subsysem Name) (string, error)

type BlkIOEntry Uses

type BlkIOEntry struct {
    Op     string `protobuf:"bytes,1,opt,name=op,proto3" json:"op,omitempty"`
    Device string `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"`
    Major  uint64 `protobuf:"varint,3,opt,name=major,proto3" json:"major,omitempty"`
    Minor  uint64 `protobuf:"varint,4,opt,name=minor,proto3" json:"minor,omitempty"`
    Value  uint64 `protobuf:"varint,5,opt,name=value,proto3" json:"value,omitempty"`
}

func (*BlkIOEntry) Descriptor Uses

func (*BlkIOEntry) Descriptor() ([]byte, []int)

func (*BlkIOEntry) Marshal Uses

func (m *BlkIOEntry) Marshal() (dAtA []byte, err error)

func (*BlkIOEntry) MarshalTo Uses

func (m *BlkIOEntry) MarshalTo(dAtA []byte) (int, error)

func (*BlkIOEntry) ProtoMessage Uses

func (*BlkIOEntry) ProtoMessage()

func (*BlkIOEntry) Reset Uses

func (m *BlkIOEntry) Reset()

func (*BlkIOEntry) Size Uses

func (m *BlkIOEntry) Size() (n int)

func (*BlkIOEntry) String Uses

func (this *BlkIOEntry) String() string

func (*BlkIOEntry) Unmarshal Uses

func (m *BlkIOEntry) Unmarshal(dAtA []byte) error

type BlkIOStat Uses

type BlkIOStat struct {
    IoServiceBytesRecursive []*BlkIOEntry `protobuf:"bytes,1,rep,name=io_service_bytes_recursive,json=ioServiceBytesRecursive" json:"io_service_bytes_recursive,omitempty"`
    IoServicedRecursive     []*BlkIOEntry `protobuf:"bytes,2,rep,name=io_serviced_recursive,json=ioServicedRecursive" json:"io_serviced_recursive,omitempty"`
    IoQueuedRecursive       []*BlkIOEntry `protobuf:"bytes,3,rep,name=io_queued_recursive,json=ioQueuedRecursive" json:"io_queued_recursive,omitempty"`
    IoServiceTimeRecursive  []*BlkIOEntry `protobuf:"bytes,4,rep,name=io_service_time_recursive,json=ioServiceTimeRecursive" json:"io_service_time_recursive,omitempty"`
    IoWaitTimeRecursive     []*BlkIOEntry `protobuf:"bytes,5,rep,name=io_wait_time_recursive,json=ioWaitTimeRecursive" json:"io_wait_time_recursive,omitempty"`
    IoMergedRecursive       []*BlkIOEntry `protobuf:"bytes,6,rep,name=io_merged_recursive,json=ioMergedRecursive" json:"io_merged_recursive,omitempty"`
    IoTimeRecursive         []*BlkIOEntry `protobuf:"bytes,7,rep,name=io_time_recursive,json=ioTimeRecursive" json:"io_time_recursive,omitempty"`
    SectorsRecursive        []*BlkIOEntry `protobuf:"bytes,8,rep,name=sectors_recursive,json=sectorsRecursive" json:"sectors_recursive,omitempty"`
}

func (*BlkIOStat) Descriptor Uses

func (*BlkIOStat) Descriptor() ([]byte, []int)

func (*BlkIOStat) Marshal Uses

func (m *BlkIOStat) Marshal() (dAtA []byte, err error)

func (*BlkIOStat) MarshalTo Uses

func (m *BlkIOStat) MarshalTo(dAtA []byte) (int, error)

func (*BlkIOStat) ProtoMessage Uses

func (*BlkIOStat) ProtoMessage()

func (*BlkIOStat) Reset Uses

func (m *BlkIOStat) Reset()

func (*BlkIOStat) Size Uses

func (m *BlkIOStat) Size() (n int)

func (*BlkIOStat) String Uses

func (this *BlkIOStat) String() string

func (*BlkIOStat) Unmarshal Uses

func (m *BlkIOStat) Unmarshal(dAtA []byte) error

type CPUStat Uses

type CPUStat struct {
    Usage      *CPUUsage `protobuf:"bytes,1,opt,name=usage" json:"usage,omitempty"`
    Throttling *Throttle `protobuf:"bytes,2,opt,name=throttling" json:"throttling,omitempty"`
}

func (*CPUStat) Descriptor Uses

func (*CPUStat) Descriptor() ([]byte, []int)

func (*CPUStat) Marshal Uses

func (m *CPUStat) Marshal() (dAtA []byte, err error)

func (*CPUStat) MarshalTo Uses

func (m *CPUStat) MarshalTo(dAtA []byte) (int, error)

func (*CPUStat) ProtoMessage Uses

func (*CPUStat) ProtoMessage()

func (*CPUStat) Reset Uses

func (m *CPUStat) Reset()

func (*CPUStat) Size Uses

func (m *CPUStat) Size() (n int)

func (*CPUStat) String Uses

func (this *CPUStat) String() string

func (*CPUStat) Unmarshal Uses

func (m *CPUStat) Unmarshal(dAtA []byte) error

type CPUUsage Uses

type CPUUsage struct {
    // values in nanoseconds
    Total  uint64   `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
    Kernel uint64   `protobuf:"varint,2,opt,name=kernel,proto3" json:"kernel,omitempty"`
    User   uint64   `protobuf:"varint,3,opt,name=user,proto3" json:"user,omitempty"`
    PerCPU []uint64 `protobuf:"varint,4,rep,packed,name=per_cpu,json=perCpu" json:"per_cpu,omitempty"`
}

func (*CPUUsage) Descriptor Uses

func (*CPUUsage) Descriptor() ([]byte, []int)

func (*CPUUsage) Marshal Uses

func (m *CPUUsage) Marshal() (dAtA []byte, err error)

func (*CPUUsage) MarshalTo Uses

func (m *CPUUsage) MarshalTo(dAtA []byte) (int, error)

func (*CPUUsage) ProtoMessage Uses

func (*CPUUsage) ProtoMessage()

func (*CPUUsage) Reset Uses

func (m *CPUUsage) Reset()

func (*CPUUsage) Size Uses

func (m *CPUUsage) Size() (n int)

func (*CPUUsage) String Uses

func (this *CPUUsage) String() string

func (*CPUUsage) Unmarshal Uses

func (m *CPUUsage) Unmarshal(dAtA []byte) error

type Cgroup Uses

type Cgroup interface {
    // New creates a new cgroup under the calling cgroup
    New(string, *specs.LinuxResources) (Cgroup, error)
    // Add adds a process to the cgroup (cgroup.procs)
    Add(Process) error
    // AddTask adds a process to the cgroup (tasks)
    AddTask(Process) error
    // Delete removes the cgroup as a whole
    Delete() error
    // MoveTo moves all the processes under the calling cgroup to the provided one
    // subsystems are moved one at a time
    MoveTo(Cgroup) error
    // Stat returns the stats for all subsystems in the cgroup
    Stat(...ErrorHandler) (*Metrics, error)
    // Update updates all the subsystems with the provided resource changes
    Update(resources *specs.LinuxResources) error
    // Processes returns all the processes in a select subsystem for the cgroup
    Processes(Name, bool) ([]Process, error)
    // Tasks returns all the tasks in a select subsystem for the cgroup
    Tasks(Name, bool) ([]Task, error)
    // Freeze freezes or pauses all processes inside the cgroup
    Freeze() error
    // Thaw thaw or resumes all processes inside the cgroup
    Thaw() error
    // OOMEventFD returns the memory subsystem's event fd for OOM events
    OOMEventFD() (uintptr, error)
    // State returns the cgroups current state
    State() State
    // Subsystems returns all the subsystems in the cgroup
    Subsystems() []Subsystem
}

Cgroup handles interactions with the individual groups to perform actions on them as them main interface to this cgroup package

func Load Uses

func Load(hierarchy Hierarchy, path Path, opts ...InitOpts) (Cgroup, error)

Load will load an existing cgroup and allow it to be controlled

func New Uses

func New(hierarchy Hierarchy, path Path, resources *specs.LinuxResources, opts ...InitOpts) (Cgroup, error)

New returns a new control via the cgroup cgroups interface

type ErrorHandler Uses

type ErrorHandler func(err error) error

ErrorHandler is a function that handles and acts on errors

type Hierarchy Uses

type Hierarchy func() ([]Subsystem, error)

Hierarchy enableds both unified and split hierarchy for cgroups

func SingleSubsystem Uses

func SingleSubsystem(baseHierarchy Hierarchy, subsystem Name) Hierarchy

SingleSubsystem returns a single cgroup subsystem within the base Hierarchy

type HugetlbStat Uses

type HugetlbStat struct {
    Usage    uint64 `protobuf:"varint,1,opt,name=usage,proto3" json:"usage,omitempty"`
    Max      uint64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
    Failcnt  uint64 `protobuf:"varint,3,opt,name=failcnt,proto3" json:"failcnt,omitempty"`
    Pagesize string `protobuf:"bytes,4,opt,name=pagesize,proto3" json:"pagesize,omitempty"`
}

func (*HugetlbStat) Descriptor Uses

func (*HugetlbStat) Descriptor() ([]byte, []int)

func (*HugetlbStat) Marshal Uses

func (m *HugetlbStat) Marshal() (dAtA []byte, err error)

func (*HugetlbStat) MarshalTo Uses

func (m *HugetlbStat) MarshalTo(dAtA []byte) (int, error)

func (*HugetlbStat) ProtoMessage Uses

func (*HugetlbStat) ProtoMessage()

func (*HugetlbStat) Reset Uses

func (m *HugetlbStat) Reset()

func (*HugetlbStat) Size Uses

func (m *HugetlbStat) Size() (n int)

func (*HugetlbStat) String Uses

func (this *HugetlbStat) String() string

func (*HugetlbStat) Unmarshal Uses

func (m *HugetlbStat) Unmarshal(dAtA []byte) error

type InitCheck Uses

type InitCheck func(Subsystem, Path, error) error

InitCheck allows subsystems errors to be checked when initialized or loaded

type InitConfig Uses

type InitConfig struct {
    // InitCheck can be used to check initialization errors from the subsystem
    InitCheck InitCheck
}

InitConfig provides configuration options for the creation or loading of a cgroup and its subsystems

type InitOpts Uses

type InitOpts func(*InitConfig) error

InitOpts allows configuration for the creation or loading of a cgroup

type MemoryEntry Uses

type MemoryEntry struct {
    Limit   uint64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
    Usage   uint64 `protobuf:"varint,2,opt,name=usage,proto3" json:"usage,omitempty"`
    Max     uint64 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"`
    Failcnt uint64 `protobuf:"varint,4,opt,name=failcnt,proto3" json:"failcnt,omitempty"`
}

func (*MemoryEntry) Descriptor Uses

func (*MemoryEntry) Descriptor() ([]byte, []int)

func (*MemoryEntry) Marshal Uses

func (m *MemoryEntry) Marshal() (dAtA []byte, err error)

func (*MemoryEntry) MarshalTo Uses

func (m *MemoryEntry) MarshalTo(dAtA []byte) (int, error)

func (*MemoryEntry) ProtoMessage Uses

func (*MemoryEntry) ProtoMessage()

func (*MemoryEntry) Reset Uses

func (m *MemoryEntry) Reset()

func (*MemoryEntry) Size Uses

func (m *MemoryEntry) Size() (n int)

func (*MemoryEntry) String Uses

func (this *MemoryEntry) String() string

func (*MemoryEntry) Unmarshal Uses

func (m *MemoryEntry) Unmarshal(dAtA []byte) error

type MemoryStat Uses

type MemoryStat struct {
    Cache                   uint64       `protobuf:"varint,1,opt,name=cache,proto3" json:"cache,omitempty"`
    RSS                     uint64       `protobuf:"varint,2,opt,name=rss,proto3" json:"rss,omitempty"`
    RSSHuge                 uint64       `protobuf:"varint,3,opt,name=rss_huge,json=rssHuge,proto3" json:"rss_huge,omitempty"`
    MappedFile              uint64       `protobuf:"varint,4,opt,name=mapped_file,json=mappedFile,proto3" json:"mapped_file,omitempty"`
    Dirty                   uint64       `protobuf:"varint,5,opt,name=dirty,proto3" json:"dirty,omitempty"`
    Writeback               uint64       `protobuf:"varint,6,opt,name=writeback,proto3" json:"writeback,omitempty"`
    PgPgIn                  uint64       `protobuf:"varint,7,opt,name=pg_pg_in,json=pgPgIn,proto3" json:"pg_pg_in,omitempty"`
    PgPgOut                 uint64       `protobuf:"varint,8,opt,name=pg_pg_out,json=pgPgOut,proto3" json:"pg_pg_out,omitempty"`
    PgFault                 uint64       `protobuf:"varint,9,opt,name=pg_fault,json=pgFault,proto3" json:"pg_fault,omitempty"`
    PgMajFault              uint64       `protobuf:"varint,10,opt,name=pg_maj_fault,json=pgMajFault,proto3" json:"pg_maj_fault,omitempty"`
    InactiveAnon            uint64       `protobuf:"varint,11,opt,name=inactive_anon,json=inactiveAnon,proto3" json:"inactive_anon,omitempty"`
    ActiveAnon              uint64       `protobuf:"varint,12,opt,name=active_anon,json=activeAnon,proto3" json:"active_anon,omitempty"`
    InactiveFile            uint64       `protobuf:"varint,13,opt,name=inactive_file,json=inactiveFile,proto3" json:"inactive_file,omitempty"`
    ActiveFile              uint64       `protobuf:"varint,14,opt,name=active_file,json=activeFile,proto3" json:"active_file,omitempty"`
    Unevictable             uint64       `protobuf:"varint,15,opt,name=unevictable,proto3" json:"unevictable,omitempty"`
    HierarchicalMemoryLimit uint64       `protobuf:"varint,16,opt,name=hierarchical_memory_limit,json=hierarchicalMemoryLimit,proto3" json:"hierarchical_memory_limit,omitempty"`
    HierarchicalSwapLimit   uint64       `protobuf:"varint,17,opt,name=hierarchical_swap_limit,json=hierarchicalSwapLimit,proto3" json:"hierarchical_swap_limit,omitempty"`
    TotalCache              uint64       `protobuf:"varint,18,opt,name=total_cache,json=totalCache,proto3" json:"total_cache,omitempty"`
    TotalRSS                uint64       `protobuf:"varint,19,opt,name=total_rss,json=totalRss,proto3" json:"total_rss,omitempty"`
    TotalRSSHuge            uint64       `protobuf:"varint,20,opt,name=total_rss_huge,json=totalRssHuge,proto3" json:"total_rss_huge,omitempty"`
    TotalMappedFile         uint64       `protobuf:"varint,21,opt,name=total_mapped_file,json=totalMappedFile,proto3" json:"total_mapped_file,omitempty"`
    TotalDirty              uint64       `protobuf:"varint,22,opt,name=total_dirty,json=totalDirty,proto3" json:"total_dirty,omitempty"`
    TotalWriteback          uint64       `protobuf:"varint,23,opt,name=total_writeback,json=totalWriteback,proto3" json:"total_writeback,omitempty"`
    TotalPgPgIn             uint64       `protobuf:"varint,24,opt,name=total_pg_pg_in,json=totalPgPgIn,proto3" json:"total_pg_pg_in,omitempty"`
    TotalPgPgOut            uint64       `protobuf:"varint,25,opt,name=total_pg_pg_out,json=totalPgPgOut,proto3" json:"total_pg_pg_out,omitempty"`
    TotalPgFault            uint64       `protobuf:"varint,26,opt,name=total_pg_fault,json=totalPgFault,proto3" json:"total_pg_fault,omitempty"`
    TotalPgMajFault         uint64       `protobuf:"varint,27,opt,name=total_pg_maj_fault,json=totalPgMajFault,proto3" json:"total_pg_maj_fault,omitempty"`
    TotalInactiveAnon       uint64       `protobuf:"varint,28,opt,name=total_inactive_anon,json=totalInactiveAnon,proto3" json:"total_inactive_anon,omitempty"`
    TotalActiveAnon         uint64       `protobuf:"varint,29,opt,name=total_active_anon,json=totalActiveAnon,proto3" json:"total_active_anon,omitempty"`
    TotalInactiveFile       uint64       `protobuf:"varint,30,opt,name=total_inactive_file,json=totalInactiveFile,proto3" json:"total_inactive_file,omitempty"`
    TotalActiveFile         uint64       `protobuf:"varint,31,opt,name=total_active_file,json=totalActiveFile,proto3" json:"total_active_file,omitempty"`
    TotalUnevictable        uint64       `protobuf:"varint,32,opt,name=total_unevictable,json=totalUnevictable,proto3" json:"total_unevictable,omitempty"`
    Usage                   *MemoryEntry `protobuf:"bytes,33,opt,name=usage" json:"usage,omitempty"`
    Swap                    *MemoryEntry `protobuf:"bytes,34,opt,name=swap" json:"swap,omitempty"`
    Kernel                  *MemoryEntry `protobuf:"bytes,35,opt,name=kernel" json:"kernel,omitempty"`
    KernelTCP               *MemoryEntry `protobuf:"bytes,36,opt,name=kernel_tcp,json=kernelTcp" json:"kernel_tcp,omitempty"`
}

func (*MemoryStat) Descriptor Uses

func (*MemoryStat) Descriptor() ([]byte, []int)

func (*MemoryStat) Marshal Uses

func (m *MemoryStat) Marshal() (dAtA []byte, err error)

func (*MemoryStat) MarshalTo Uses

func (m *MemoryStat) MarshalTo(dAtA []byte) (int, error)

func (*MemoryStat) ProtoMessage Uses

func (*MemoryStat) ProtoMessage()

func (*MemoryStat) Reset Uses

func (m *MemoryStat) Reset()

func (*MemoryStat) Size Uses

func (m *MemoryStat) Size() (n int)

func (*MemoryStat) String Uses

func (this *MemoryStat) String() string

func (*MemoryStat) Unmarshal Uses

func (m *MemoryStat) Unmarshal(dAtA []byte) error

type Metrics Uses

type Metrics struct {
    Hugetlb []*HugetlbStat `protobuf:"bytes,1,rep,name=hugetlb" json:"hugetlb,omitempty"`
    Pids    *PidsStat      `protobuf:"bytes,2,opt,name=pids" json:"pids,omitempty"`
    CPU     *CPUStat       `protobuf:"bytes,3,opt,name=cpu" json:"cpu,omitempty"`
    Memory  *MemoryStat    `protobuf:"bytes,4,opt,name=memory" json:"memory,omitempty"`
    Blkio   *BlkIOStat     `protobuf:"bytes,5,opt,name=blkio" json:"blkio,omitempty"`
    Rdma    *RdmaStat      `protobuf:"bytes,6,opt,name=rdma" json:"rdma,omitempty"`
    Network []*NetworkStat `protobuf:"bytes,7,rep,name=network" json:"network,omitempty"`
}

func (*Metrics) Descriptor Uses

func (*Metrics) Descriptor() ([]byte, []int)

func (*Metrics) Marshal Uses

func (m *Metrics) Marshal() (dAtA []byte, err error)

func (*Metrics) MarshalTo Uses

func (m *Metrics) MarshalTo(dAtA []byte) (int, error)

func (*Metrics) ProtoMessage Uses

func (*Metrics) ProtoMessage()

func (*Metrics) Reset Uses

func (m *Metrics) Reset()

func (*Metrics) Size Uses

func (m *Metrics) Size() (n int)

func (*Metrics) String Uses

func (this *Metrics) String() string

func (*Metrics) Unmarshal Uses

func (m *Metrics) Unmarshal(dAtA []byte) error

type Name Uses

type Name string

Name is a typed name for a cgroup subsystem

const (
    Devices   Name = "devices"
    Hugetlb   Name = "hugetlb"
    Freezer   Name = "freezer"
    Pids      Name = "pids"
    NetCLS    Name = "net_cls"
    NetPrio   Name = "net_prio"
    PerfEvent Name = "perf_event"
    Cpuset    Name = "cpuset"
    Cpu       Name = "cpu"
    Cpuacct   Name = "cpuacct"
    Memory    Name = "memory"
    Blkio     Name = "blkio"
    Rdma      Name = "rdma"
)
const (
    SystemdDbus Name = "systemd"
)

func Subsystems Uses

func Subsystems() []Name

Subsystems returns a complete list of the default cgroups available on most linux systems

type NetworkStat Uses

type NetworkStat struct {
    Name      string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    RxBytes   uint64 `protobuf:"varint,2,opt,name=rx_bytes,json=rxBytes,proto3" json:"rx_bytes,omitempty"`
    RxPackets uint64 `protobuf:"varint,3,opt,name=rx_packets,json=rxPackets,proto3" json:"rx_packets,omitempty"`
    RxErrors  uint64 `protobuf:"varint,4,opt,name=rx_errors,json=rxErrors,proto3" json:"rx_errors,omitempty"`
    RxDropped uint64 `protobuf:"varint,5,opt,name=rx_dropped,json=rxDropped,proto3" json:"rx_dropped,omitempty"`
    TxBytes   uint64 `protobuf:"varint,6,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"`
    TxPackets uint64 `protobuf:"varint,7,opt,name=tx_packets,json=txPackets,proto3" json:"tx_packets,omitempty"`
    TxErrors  uint64 `protobuf:"varint,8,opt,name=tx_errors,json=txErrors,proto3" json:"tx_errors,omitempty"`
    TxDropped uint64 `protobuf:"varint,9,opt,name=tx_dropped,json=txDropped,proto3" json:"tx_dropped,omitempty"`
}

func (*NetworkStat) Descriptor Uses

func (*NetworkStat) Descriptor() ([]byte, []int)

func (*NetworkStat) Marshal Uses

func (m *NetworkStat) Marshal() (dAtA []byte, err error)

func (*NetworkStat) MarshalTo Uses

func (m *NetworkStat) MarshalTo(dAtA []byte) (int, error)

func (*NetworkStat) ProtoMessage Uses

func (*NetworkStat) ProtoMessage()

func (*NetworkStat) Reset Uses

func (m *NetworkStat) Reset()

func (*NetworkStat) Size Uses

func (m *NetworkStat) Size() (n int)

func (*NetworkStat) String Uses

func (this *NetworkStat) String() string

func (*NetworkStat) Unmarshal Uses

func (m *NetworkStat) Unmarshal(dAtA []byte) error

type Path Uses

type Path func(subsystem Name) (string, error)

func NestedPath Uses

func NestedPath(suffix string) Path

NestedPath will nest the cgroups based on the calling processes cgroup placing its child processes inside its own path

func PidPath Uses

func PidPath(pid int) Path

PidPath will return the correct cgroup paths for an existing process running inside a cgroup This is commonly used for the Load function to restore an existing container

func Slice Uses

func Slice(slice, name string) Path

func StaticPath Uses

func StaticPath(path string) Path

StaticPath returns a static path to use for all cgroups

type PerfEventController Uses

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

func NewPerfEvent Uses

func NewPerfEvent(root string) *PerfEventController

func (*PerfEventController) Name Uses

func (p *PerfEventController) Name() Name

func (*PerfEventController) Path Uses

func (p *PerfEventController) Path(path string) string

type PidsStat Uses

type PidsStat struct {
    Current uint64 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"`
    Limit   uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
}

func (*PidsStat) Descriptor Uses

func (*PidsStat) Descriptor() ([]byte, []int)

func (*PidsStat) Marshal Uses

func (m *PidsStat) Marshal() (dAtA []byte, err error)

func (*PidsStat) MarshalTo Uses

func (m *PidsStat) MarshalTo(dAtA []byte) (int, error)

func (*PidsStat) ProtoMessage Uses

func (*PidsStat) ProtoMessage()

func (*PidsStat) Reset Uses

func (m *PidsStat) Reset()

func (*PidsStat) Size Uses

func (m *PidsStat) Size() (n int)

func (*PidsStat) String Uses

func (this *PidsStat) String() string

func (*PidsStat) Unmarshal Uses

func (m *PidsStat) Unmarshal(dAtA []byte) error

type Process Uses

type Process struct {
    // Subsystem is the name of the subsystem that the process is in
    Subsystem Name
    // Pid is the process id of the process
    Pid int
    // Path is the full path of the subsystem and location that the process is in
    Path string
}

type RdmaEntry Uses

type RdmaEntry struct {
    Device     string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
    HcaHandles uint32 `protobuf:"varint,2,opt,name=hca_handles,json=hcaHandles,proto3" json:"hca_handles,omitempty"`
    HcaObjects uint32 `protobuf:"varint,3,opt,name=hca_objects,json=hcaObjects,proto3" json:"hca_objects,omitempty"`
}

func (*RdmaEntry) Descriptor Uses

func (*RdmaEntry) Descriptor() ([]byte, []int)

func (*RdmaEntry) Marshal Uses

func (m *RdmaEntry) Marshal() (dAtA []byte, err error)

func (*RdmaEntry) MarshalTo Uses

func (m *RdmaEntry) MarshalTo(dAtA []byte) (int, error)

func (*RdmaEntry) ProtoMessage Uses

func (*RdmaEntry) ProtoMessage()

func (*RdmaEntry) Reset Uses

func (m *RdmaEntry) Reset()

func (*RdmaEntry) Size Uses

func (m *RdmaEntry) Size() (n int)

func (*RdmaEntry) String Uses

func (this *RdmaEntry) String() string

func (*RdmaEntry) Unmarshal Uses

func (m *RdmaEntry) Unmarshal(dAtA []byte) error

type RdmaStat Uses

type RdmaStat struct {
    Current []*RdmaEntry `protobuf:"bytes,1,rep,name=current" json:"current,omitempty"`
    Limit   []*RdmaEntry `protobuf:"bytes,2,rep,name=limit" json:"limit,omitempty"`
}

func (*RdmaStat) Descriptor Uses

func (*RdmaStat) Descriptor() ([]byte, []int)

func (*RdmaStat) Marshal Uses

func (m *RdmaStat) Marshal() (dAtA []byte, err error)

func (*RdmaStat) MarshalTo Uses

func (m *RdmaStat) MarshalTo(dAtA []byte) (int, error)

func (*RdmaStat) ProtoMessage Uses

func (*RdmaStat) ProtoMessage()

func (*RdmaStat) Reset Uses

func (m *RdmaStat) Reset()

func (*RdmaStat) Size Uses

func (m *RdmaStat) Size() (n int)

func (*RdmaStat) String Uses

func (this *RdmaStat) String() string

func (*RdmaStat) Unmarshal Uses

func (m *RdmaStat) Unmarshal(dAtA []byte) error

type State Uses

type State string

State is a type that represents the state of the current cgroup

const (
    Unknown  State = ""
    Thawed   State = "thawed"
    Frozen   State = "frozen"
    Freezing State = "freezing"
    Deleted  State = "deleted"
)

type Subsystem Uses

type Subsystem interface {
    Name() Name
}

func Systemd Uses

func Systemd() ([]Subsystem, error)

func V1 Uses

func V1() ([]Subsystem, error)

V1 returns all the groups in the default cgroups mountpoint in a single hierarchy

type SystemdController Uses

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

func NewSystemd Uses

func NewSystemd(root string) (*SystemdController, error)

func (*SystemdController) Create Uses

func (s *SystemdController) Create(path string, resources *specs.LinuxResources) error

func (*SystemdController) Delete Uses

func (s *SystemdController) Delete(path string) error

func (*SystemdController) Name Uses

func (s *SystemdController) Name() Name

type Task Uses

type Task struct {
    // Subsystem is the name of the subsystem that the task is in
    Subsystem Name
    // Pid is the process id of the task
    Pid int
    // Path is the full path of the subsystem and location that the task is in
    Path string
}

type Throttle Uses

type Throttle struct {
    Periods          uint64 `protobuf:"varint,1,opt,name=periods,proto3" json:"periods,omitempty"`
    ThrottledPeriods uint64 `protobuf:"varint,2,opt,name=throttled_periods,json=throttledPeriods,proto3" json:"throttled_periods,omitempty"`
    ThrottledTime    uint64 `protobuf:"varint,3,opt,name=throttled_time,json=throttledTime,proto3" json:"throttled_time,omitempty"`
}

func (*Throttle) Descriptor Uses

func (*Throttle) Descriptor() ([]byte, []int)

func (*Throttle) Marshal Uses

func (m *Throttle) Marshal() (dAtA []byte, err error)

func (*Throttle) MarshalTo Uses

func (m *Throttle) MarshalTo(dAtA []byte) (int, error)

func (*Throttle) ProtoMessage Uses

func (*Throttle) ProtoMessage()

func (*Throttle) Reset Uses

func (m *Throttle) Reset()

func (*Throttle) Size Uses

func (m *Throttle) Size() (n int)

func (*Throttle) String Uses

func (this *Throttle) String() string

func (*Throttle) Unmarshal Uses

func (m *Throttle) Unmarshal(dAtA []byte) error

Package cgroups imports 23 packages (graph) and is imported by 132 packages. Updated 2019-07-17. Refresh now. Tools for package owners.