Documentation
¶
Index ¶
- Variables
- func FindCgroupMountpoint(subsystem string) (string, error)
- func GetInitCgroupDir(subsystem string) (string, error)
- func GetThisCgroupDir(subsystem string) (string, error)
- func ReadProcsFile(dir string) ([]int, error)
- type ActiveCgroup
- type BlkioStatEntry
- type BlockioStats
- type Cgroup
- type CpuStats
- type CpuUsage
- type FreezerStats
- type MemoryStats
- type Stats
- type ThrottlingData
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("mountpoint not found")
)
Functions ¶
func GetInitCgroupDir ¶
func GetThisCgroupDir ¶
Returns the relative path to the cgroup docker is running in.
func ReadProcsFile ¶
Types ¶
type ActiveCgroup ¶
type ActiveCgroup interface {
Cleanup() error
}
type BlkioStatEntry ¶
type BlockioStats ¶
type BlockioStats struct {
// number of bytes tranferred to and from the block device
IoServiceBytesRecursive []BlkioStatEntry `json:"io_service_bytes_recursive,omitempty"`
IoServicedRecursive []BlkioStatEntry `json:"io_serviced_recusrive,omitempty"`
IoQueuedRecursive []BlkioStatEntry `json:"io_queue_recursive,omitempty"`
}
type Cgroup ¶
type Cgroup struct {
Name string `json:"name,omitempty"`
Parent string `json:"parent,omitempty"`
DeviceAccess bool `json:"device_access,omitempty"` // name of parent cgroup or slice
Memory int64 `json:"memory,omitempty"` // Memory limit (in bytes)
MemoryReservation int64 `json:"memory_reservation,omitempty"` // Memory reservation or soft_limit (in bytes)
MemorySwap int64 `json:"memory_swap,omitempty"` // Total memory usage (memory + swap); set `-1' to disable swap
CpuQuota int64 `json:"cpu_quota,omitempty"` // CPU hardcap limit (in usecs). Allowed cpu time in a given period.
CpuPeriod int64 `json:"cpu_period,omitempty"` // CPU period to be used for hardcapping (in usecs). 0 to use system default.
CpusetCpus string `json:"cpuset_cpus,omitempty"` // CPU to use
Freezer string `json:"freezer,omitempty"` // set the freeze value for the process
Slice string `json:"slice,omitempty"` // Parent slice to use for systemd
}
type CpuStats ¶
type CpuStats struct {
CpuUsage CpuUsage `json:"cpu_usage,omitempty"`
ThrottlingData ThrottlingData `json:"throlling_data,omitempty"`
}
type FreezerStats ¶
type FreezerStats struct {
ParentState string `json:"parent_state,omitempty"`
SelfState string `json:"self_state,omitempty"`
}
TODO(Vishh): Remove freezer from stats since it does not logically belong in stats.
type MemoryStats ¶
type MemoryStats struct {
// current res_counter usage for memory
Usage int64 `json:"usage,omitempty"`
// maximum usage ever recorded.
MaxUsage int64 `json:"max_usage,omitempty"`
// TODO(vishh): Export these as stronger types.
// all the stats exported via memory.stat.
Stats map[string]int64 `json:"stats,omitempty"`
}
type Stats ¶
type Stats struct {
CpuStats CpuStats `json:"cpu_stats,omitempty"`
MemoryStats MemoryStats `json:"memory_stats,omitempty"`
BlockioStats BlockioStats `json:"blockio_stats,omitempty"`
FreezerStats FreezerStats `json:"freezer_stats,omitempty"`
}
type ThrottlingData ¶
type ThrottlingData struct {
// Number of periods with throttling active
Periods int64 `json:"periods,omitempty"`
// Number of periods when the container hit its throttling limit.
ThrottledPeriods int64 `json:"throttled_periods,omitempty"`
// Aggregate time the container was throttled for in nanoseconds.
ThrottledTime int64 `json:"throttled_time,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.