container

package
v0.0.0-...-9e6775c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wait

func Wait(ctx context.Context, cli *client.Client, cid, state string) error

Wait waits for a container of given container id to reach a specified state. If an error is encountered during the wait, it is returned.

Types

type OverallMetrics

type OverallMetrics struct {
	TotalCPU     float64
	TotalMem     float64
	TotalNet     netStat
	TotalBlk     blkStat
	PerContainer []PerContainerMetrics
}

OverallMetrics holds metrics for all existing containers

func GetOverallMetrics

func GetOverallMetrics(ctx context.Context, cli *client.Client, all bool) (OverallMetrics, error)

GetOverallMetrics provides metrics about all running containers in the form of OverallMetrics structs

type PerContainerMetrics

type PerContainerMetrics struct {
	// Metrics common for Overall and per container
	ID     string
	Image  string
	Name   string
	Status string
	State  string
	CPU    float64
	Mem    float64
	Net    netStat
	Blk    blkStat
	// Metrics specific to per container
	Pid     string
	NetInfo []netInfo
	PerCPU  []string
	PortMap []portMap
	Mounts  []mountInfo
	Procs   []procInfo
}

PerContainerMetrics holds metrics for a given container

func GetContainerMetrics

func GetContainerMetrics(ctx context.Context, cli *client.Client, cid string) (PerContainerMetrics, error)

GetContainerMetrics provides per container metrics in the form of PerContainerMetrics Structs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL