gopsutil: github.com/influxdata/gopsutil/docker Index | Files

package docker

import "github.com/influxdata/gopsutil/docker"

Index

Package Files

docker.go docker_linux.go

Variables

var ErrCgroupNotAvailable = errors.New("cgroup not available")
var ErrDockerNotAvailable = errors.New("docker not available")

func CgroupCPU Uses

func CgroupCPU(containerID string, base string) (*cpu.TimesStat, error)

CgroupCPU returnes specified cgroup id CPU status. containerID is same as docker id if you use docker. If you use container via systemd.slice, you could use containerID = docker-<container id>.scope and base=/sys/fs/cgroup/cpuacct/system.slice/

func CgroupCPUDocker Uses

func CgroupCPUDocker(containerid string) (*cpu.TimesStat, error)

func CgroupCPUDockerUsageWithContext Uses

func CgroupCPUDockerUsageWithContext(ctx context.Context, containerid string) (float64, error)

func CgroupCPUDockerWithContext Uses

func CgroupCPUDockerWithContext(ctx context.Context, containerid string) (*cpu.TimesStat, error)

func CgroupCPUUsage Uses

func CgroupCPUUsage(containerID string, base string) (float64, error)

CgroupCPUUsage returnes specified cgroup id CPU usage. containerID is same as docker id if you use docker. If you use container via systemd.slice, you could use containerID = docker-<container id>.scope and base=/sys/fs/cgroup/cpuacct/system.slice/

func CgroupCPUUsageDocker Uses

func CgroupCPUUsageDocker(containerid string) (float64, error)

func CgroupCPUUsageWithContext Uses

func CgroupCPUUsageWithContext(ctx context.Context, containerID, base string) (float64, error)

func CgroupCPUWithContext Uses

func CgroupCPUWithContext(ctx context.Context, containerID string, base string) (*cpu.TimesStat, error)

func GetDockerIDList Uses

func GetDockerIDList() ([]string, error)

GetDockerIDList returnes a list of DockerID. This requires certain permission.

func GetDockerIDListWithContext Uses

func GetDockerIDListWithContext(ctx context.Context) ([]string, error)

type CgroupCPUStat Uses

type CgroupCPUStat struct {
    cpu.TimesStat
    Usage float64
}

type CgroupDockerStat Uses

type CgroupDockerStat struct {
    ContainerID string `json:"containerID"`
    Name        string `json:"name"`
    Image       string `json:"image"`
    Status      string `json:"status"`
    Running     bool   `json:"running"`
}

func GetDockerStat Uses

func GetDockerStat() ([]CgroupDockerStat, error)

GetDockerStat returns a list of Docker basic stats. This requires certain permission.

func GetDockerStatWithContext Uses

func GetDockerStatWithContext(ctx context.Context) ([]CgroupDockerStat, error)

func (CgroupDockerStat) String Uses

func (c CgroupDockerStat) String() string

type CgroupMemStat Uses

type CgroupMemStat struct {
    ContainerID             string `json:"containerID"`
    Cache                   uint64 `json:"cache"`
    RSS                     uint64 `json:"rss"`
    RSSHuge                 uint64 `json:"rssHuge"`
    MappedFile              uint64 `json:"mappedFile"`
    Pgpgin                  uint64 `json:"pgpgin"`
    Pgpgout                 uint64 `json:"pgpgout"`
    Pgfault                 uint64 `json:"pgfault"`
    Pgmajfault              uint64 `json:"pgmajfault"`
    InactiveAnon            uint64 `json:"inactiveAnon"`
    ActiveAnon              uint64 `json:"activeAnon"`
    InactiveFile            uint64 `json:"inactiveFile"`
    ActiveFile              uint64 `json:"activeFile"`
    Unevictable             uint64 `json:"unevictable"`
    HierarchicalMemoryLimit uint64 `json:"hierarchicalMemoryLimit"`
    TotalCache              uint64 `json:"totalCache"`
    TotalRSS                uint64 `json:"totalRss"`
    TotalRSSHuge            uint64 `json:"totalRssHuge"`
    TotalMappedFile         uint64 `json:"totalMappedFile"`
    TotalPgpgIn             uint64 `json:"totalPgpgin"`
    TotalPgpgOut            uint64 `json:"totalPgpgout"`
    TotalPgFault            uint64 `json:"totalPgfault"`
    TotalPgMajFault         uint64 `json:"totalPgmajfault"`
    TotalInactiveAnon       uint64 `json:"totalInactiveAnon"`
    TotalActiveAnon         uint64 `json:"totalActiveAnon"`
    TotalInactiveFile       uint64 `json:"totalInactiveFile"`
    TotalActiveFile         uint64 `json:"totalActiveFile"`
    TotalUnevictable        uint64 `json:"totalUnevictable"`
    MemUsageInBytes         uint64 `json:"memUsageInBytes"`
    MemMaxUsageInBytes      uint64 `json:"memMaxUsageInBytes"`
    MemLimitInBytes         uint64 `json:"memoryLimitInBbytes"`
    MemFailCnt              uint64 `json:"memoryFailcnt"`
}

func CgroupMem Uses

func CgroupMem(containerID string, base string) (*CgroupMemStat, error)

func CgroupMemDocker Uses

func CgroupMemDocker(containerID string) (*CgroupMemStat, error)

func CgroupMemDockerWithContext Uses

func CgroupMemDockerWithContext(ctx context.Context, containerID string) (*CgroupMemStat, error)

func CgroupMemWithContext Uses

func CgroupMemWithContext(ctx context.Context, containerID string, base string) (*CgroupMemStat, error)

func (CgroupMemStat) String Uses

func (m CgroupMemStat) String() string

Package docker imports 11 packages (graph). Updated 2019-10-13. Refresh now. Tools for package owners.