statsutil

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerStats added in v0.22.1

type ContainerStats struct {
	Time                        time.Time
	CgroupCPU, Cgroup2CPU       uint64
	CgroupSystem, Cgroup2System uint64
}

ContainerStats represents the runtime container stats

type FormattedStatsEntry

type FormattedStatsEntry struct {
	Name     string
	ID       string
	CPUPerc  string
	MemUsage string
	MemPerc  string
	NetIO    string
	BlockIO  string
	PIDs     string
}

FormattedStatsEntry represents a formatted StatsEntry

func RenderEntry

func RenderEntry(in *StatsEntry, noTrunc bool) FormattedStatsEntry

Rendering a FormattedStatsEntry from StatsEntry

type StatsEntry

type StatsEntry struct {
	Container        string
	Name             string
	ID               string
	CPUPercentage    float64
	Memory           float64
	MemoryLimit      float64
	MemoryPercentage float64
	NetworkRx        float64
	NetworkTx        float64
	BlockRead        float64
	BlockWrite       float64
	PidsCurrent      uint64
	IsInvalid        bool
}

StatsEntry represents the statistics data collected from a container

func SetCgroup2StatsFields

func SetCgroup2StatsFields(previousStats *ContainerStats, metrics *v2.Metrics, links []netlink.Link) (StatsEntry, error)

func SetCgroupStatsFields

func SetCgroupStatsFields(previousStats *ContainerStats, data *v1.Metrics, links []netlink.Link) (StatsEntry, error)

func (*StatsEntry) BlockIO

func (s *StatsEntry) BlockIO() string

func (*StatsEntry) CPUPerc

func (s *StatsEntry) CPUPerc() string

func (*StatsEntry) EntryID

func (s *StatsEntry) EntryID(noTrunc bool) string

func (*StatsEntry) EntryName

func (s *StatsEntry) EntryName() string

a set of functions to format container stats

func (*StatsEntry) MemPerc

func (s *StatsEntry) MemPerc() string

func (*StatsEntry) MemUsage

func (s *StatsEntry) MemUsage() string

func (*StatsEntry) NetIO

func (s *StatsEntry) NetIO() string

func (*StatsEntry) PIDs

func (s *StatsEntry) PIDs() string

Jump to

Keyboard shortcuts

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