Documentation ¶
Overview ¶
Unmarshal's a Containers description json file. The json file contains an array of ContainerHint structs, each with a container's id and networkInterface This allows collecting stats about network interfaces configured outside docker and lxc
Handler for Docker containers.
Index ¶
- Constants
- Variables
- func AssignDeviceNamesToDiskStats(namer DeviceNamer, stats *info.DiskIoStats)
- func CgroupExists(cgroupPaths map[string]string) bool
- func DebugInfo(watches map[string][]string) map[string][]string
- func GetContainerHintsFromFile(containerHintsFile string) (containerHints, error)
- func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoFactory, ...) (info.ContainerSpec, error)
- func ListContainers(name string, cgroupPaths map[string]string, listType container.ListType) ([]info.ContainerReference, error)
- func ListDirectories(dirpath string, parent string, recursive bool, output map[string]struct{}) error
- func MakeCgroupPaths(mountPoints map[string]string, name string) map[string]string
- type DeviceNamer
- type FsHandler
- type FsUsage
- type FsnotifyWatcher
- func (iw *FsnotifyWatcher) AddWatch(containerName, dir string) (bool, error)
- func (iw *FsnotifyWatcher) Close() error
- func (iw *FsnotifyWatcher) Error() chan error
- func (iw *FsnotifyWatcher) Event() chan fsnotify.Event
- func (iw *FsnotifyWatcher) GetWatches() map[string][]string
- func (iw *FsnotifyWatcher) RemoveWatch(containerName, dir string) (bool, error)
- type MachineInfoNamer
- type Mount
Constants ¶
const DefaultPeriod = time.Minute
Variables ¶
var ArgContainerHints = flag.String("container_hints", "/etc/cadvisor/container_hints.json", "location of the container hints file")
Functions ¶
func AssignDeviceNamesToDiskStats ¶ added in v0.26.0
func AssignDeviceNamesToDiskStats(namer DeviceNamer, stats *info.DiskIoStats)
AssignDeviceNamesToDiskStats assigns the Device field on the provided DiskIoStats by looking up the device major and minor identifiers in the provided device namer.
func CgroupExists ¶
func GetSpec ¶
func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoFactory, hasNetwork, hasFilesystem bool) (info.ContainerSpec, error)
func ListContainers ¶ added in v0.23.1
Types ¶
type DeviceNamer ¶ added in v0.26.0
type DeviceNamer interface { // DeviceName returns the name of the device by its major and minor ids, or false if no // such device is recognized. DeviceName(major, minor uint64) (string, bool) }
DeviceNamer returns string names for devices by their major and minor id.
type FsnotifyWatcher ¶ added in v0.29.2
type FsnotifyWatcher struct {
// contains filtered or unexported fields
}
Watcher for container-related fsnotify events in the cgroup hierarchy.
Implementation is thread-safe.
func NewFsnotifyWatcher ¶ added in v0.29.2
func NewFsnotifyWatcher() (*FsnotifyWatcher, error)
func (*FsnotifyWatcher) AddWatch ¶ added in v0.29.2
func (iw *FsnotifyWatcher) AddWatch(containerName, dir string) (bool, error)
Add a watch to the specified directory. Returns if the container was already being watched.
func (*FsnotifyWatcher) Close ¶ added in v0.29.2
func (iw *FsnotifyWatcher) Close() error
Closes the fsnotify watcher.
func (*FsnotifyWatcher) Error ¶ added in v0.29.2
func (iw *FsnotifyWatcher) Error() chan error
Errors are returned on this channel.
func (*FsnotifyWatcher) Event ¶ added in v0.29.2
func (iw *FsnotifyWatcher) Event() chan fsnotify.Event
Events are returned on this channel.
func (*FsnotifyWatcher) GetWatches ¶ added in v0.29.2
func (iw *FsnotifyWatcher) GetWatches() map[string][]string
Returns a map of containers to the cgroup paths being watched.
func (*FsnotifyWatcher) RemoveWatch ¶ added in v0.29.2
func (iw *FsnotifyWatcher) RemoveWatch(containerName, dir string) (bool, error)
Remove watch from the specified directory. Returns if this was the last watch on the specified container.
type MachineInfoNamer ¶ added in v0.26.0
type MachineInfoNamer info.MachineInfo
func (*MachineInfoNamer) DeviceName ¶ added in v0.26.0
func (n *MachineInfoNamer) DeviceName(major, minor uint64) (string, bool)