model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergePodResources

func MergePodResources(resources ...map[string]*PodResource) (map[string]*PodResource, error)

Types

type Aggregation

type Aggregation int
const (
	Container Aggregation = iota
	Pod
	Namespace
	Node
	Total
)

func AggregationFromString

func AggregationFromString(s string) (Aggregation, error)

type Args

type Args struct {
	ResourceFinder genericclioptions.ResourceFinder
	Aggregation    Aggregation
	AllNamespaces  bool
	Verbose        bool
	ShowNodes      bool
	ColoredOutput  bool
	OnlyWarnings   bool
}

type ContainerResource

type ContainerResource struct {
	Name   string
	Cpu    Resource
	Memory Resource
}

type PodResource

type PodResource struct {
	Name       string
	Namespace  string
	Node       string
	Containers map[string]*ContainerResource
}

func (*PodResource) Cpu

func (p *PodResource) Cpu() *Resource

func (*PodResource) Memory

func (p *PodResource) Memory() *Resource

type Resource

type Resource struct {
	Request int64
	Limit   int64
	Usage   int64
}

func (*Resource) ExceedsRequest

func (r *Resource) ExceedsRequest() bool

func (Resource) Merge

func (r Resource) Merge(other Resource) Resource

Jump to

Keyboard shortcuts

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