Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerInfo ¶
type ContainerInfo struct { ContainerReference // The direct subcontainers of the current container. Subcontainers []ContainerReference `json:"subcontainers,omitempty"` // The isolation used in the container. Spec *ContainerSpec `json:"spec,omitempty"` // Historical statistics gathered from the container. Stats []*ContainerStats `json:"stats,omitempty"` StatsSummary *ContainerStatsPercentiles `json:"stats_summary,omitempty"` }
func (*ContainerInfo) StatsAfter ¶
func (self *ContainerInfo) StatsAfter(ref time.Time) []*ContainerStats
func (*ContainerInfo) StatsEndTime ¶
func (self *ContainerInfo) StatsEndTime() time.Time
func (*ContainerInfo) StatsStartTime ¶
func (self *ContainerInfo) StatsStartTime() time.Time
type ContainerReference ¶
type ContainerReference struct { // The absolute name of the container. Name string `json:"name"` Aliases []string `json:"aliases,omitempty"` }
Container reference contains enough information to uniquely identify a container
type ContainerSpec ¶
type ContainerSpec struct { Cpu *CpuSpec `json:"cpu,omitempty"` Memory *MemorySpec `json:"memory,omitempty"` }
type ContainerStats ¶
type ContainerStats struct { // The time of this stat point. Timestamp time.Time `json:"timestamp"` Cpu *CpuStats `json:"cpu,omitempty"` Memory *MemoryStats `json:"memory,omitempty"` }
type ContainerStatsPercentiles ¶
type ContainerStatsPercentiles struct { // TODO(dengnan): More things? MaxMemoryUsage uint64 `json:"max_memory_usage,omitempty"` Samples []*ContainerStatsSample `json:"samples,omitempty"` MemoryUsagePercentiles []percentile `json:"memory_usage_percentiles,omitempty"` CpuUsagePercentiles []percentile `json:"cpu_usage_percentiles,omitempty"` }
func (*ContainerStatsPercentiles) FillPercentiles ¶
func (self *ContainerStatsPercentiles) FillPercentiles(cpuPercentages, memoryPercentages []int)
type ContainerStatsSample ¶
type ContainerStatsSample struct { // Timetamp of the end of the sample period Timestamp time.Time `json:"timestamp"` // Duration of the sample period Duration time.Duration `json:"duration"` Cpu struct { // number of nanoseconds of CPU time used by the container Usage uint64 `json:"usage"` } `json:"cpu"` Memory struct { // Units: Bytes. Usage uint64 `json:"usage"` } `json:"memory"` }
func NewSample ¶
func NewSample(prev, current *ContainerStats) (*ContainerStatsSample, error)
Each sample needs two stats because the cpu usage in ContainerStats is cumulative. prev should be an earlier observation than current. This method is not thread/goroutine safe.
type CpuSpec ¶
type CpuSpec struct { Limit uint64 `json:"limit"` MaxLimit uint64 `json:"max_limit"` Mask CpuSpecMask `json:"mask,omitempty"` }
type CpuSpecMask ¶
type CpuSpecMask struct {
Data []uint64 `json:"data,omitempty"`
}
type CpuStats ¶
type CpuStats struct { Usage struct { // Total CPU usage. // Units: nanoseconds Total uint64 `json:"total"` // Per CPU/core usage of the container. // Unit: nanoseconds. PerCpu []uint64 `json:"per_cpu,omitempty"` // Time spent in user space. // Unit: nanoseconds User uint64 `json:"user"` // Time spent in kernel space. // Unit: nanoseconds System uint64 `json:"system"` } `json:"usage"` Load int32 `json:"load"` }
All CPU usage metrics are cumulative from the creation of the container
type MachineInfo ¶
type MachineInfoFactory ¶
type MachineInfoFactory interface {
GetMachineInfo() (*MachineInfo, error)
}
type MemorySpec ¶
type MemorySpec struct { // The amount of memory requested. Default is unlimited (-1). // Units: bytes. Limit uint64 `json:"limit,omitempty"` // The amount of guaranteed memory. Default is 0. // Units: bytes. Reservation uint64 `json:"reservation,omitempty"` // The amount of swap space requested. Default is unlimited (-1). // Units: bytes. SwapLimit uint64 `json:"swap_limit,omitempty"` }
type MemoryStats ¶
type MemoryStats struct { // Memory limit, equivalent to "limit" in MemorySpec. // Units: Bytes. Limit uint64 `json:"limit,omitempty"` // Current memory usage, this includes all memory regardless of when it was // accessed. // Units: Bytes. Usage uint64 `json:"usage,omitempty"` // The amount of working set memory, this includes recently accessed memory, // dirty memory, and kernel memory. Working set is <= "usage". // Units: Bytes. WorkingSet uint64 `json:"working_set,omitempty"` ContainerData MemoryStatsMemoryData `json:"container_data,omitempty"` HierarchicalData MemoryStatsMemoryData `json:"hierarchical_data,omitempty"` }
type MemoryStatsMemoryData ¶
Click to show internal directories.
Click to hide internal directories.