resource

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SummarizedType = "Summarized"
	AllType        = "All"
	NodeType       = "Node"
)

Functions

func ResetTableShapeFrom

func ResetTableShapeFrom(typ string, rect image.Rectangle) (string, []string, []int)

func TableTypeCircle

func TableTypeCircle() *ring.Ring

Types

type NodeResource

type NodeResource struct {
	// contains filtered or unexported fields
}

func NewNodeResource

func NewNodeResource(n corev1.Node, nm metrics.NodeMetrics) *NodeResource

func (*NodeResource) GetCpuUsagePercentage

func (r *NodeResource) GetCpuUsagePercentage() (float64, string)

func (*NodeResource) GetMemoryUsagePercentage

func (r *NodeResource) GetMemoryUsagePercentage() (float64, string)

func (*NodeResource) GetNodeName

func (r *NodeResource) GetNodeName() string

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func (*Resource) GetContainerName

func (r *Resource) GetContainerName() string

func (*Resource) GetCpuLimits

func (r *Resource) GetCpuLimits() (float64, string, bool)

func (*Resource) GetCpuUsage

func (r *Resource) GetCpuUsage() (float64, string)

func (*Resource) GetMemoryLimits

func (r *Resource) GetMemoryLimits() (float64, string, bool)

func (*Resource) GetMemoryUsage

func (r *Resource) GetMemoryUsage() (float64, string)

func (*Resource) GetNodeName

func (r *Resource) GetNodeName() string

type ResourceTableViewer

type ResourceTableViewer interface {
	GetTableShape(rect image.Rectangle) (string, []string, []int, [][]string)
	SortRows()
}

func AsAllTableViewer

func AsAllTableViewer(resources []*Resource, sortType SortType) ResourceTableViewer

func AsNodeTableViewer

func AsNodeTableViewer(resources []*NodeResource, sortType SortType) ResourceTableViewer

func AsSummarizedTableViewer

func AsSummarizedTableViewer(resources []*SummarizedResource, sortType SortType) ResourceTableViewer

type SortType

type SortType int
const (
	ByName SortType = iota
)

type SummarizedResource

type SummarizedResource struct {
	// contains filtered or unexported fields
}

func NewSummarizedResource

func NewSummarizedResource(p corev1.Pod, sumUsage corev1.ResourceList) *SummarizedResource

func (*SummarizedResource) GetCpuUsage

func (s *SummarizedResource) GetCpuUsage() (float64, string)

func (*SummarizedResource) GetMemoryUsage

func (s *SummarizedResource) GetMemoryUsage() (float64, string)

func (*SummarizedResource) GetNodeName

func (s *SummarizedResource) GetNodeName() string

func (*SummarizedResource) GetPodName

func (s *SummarizedResource) GetPodName() string

Jump to

Keyboard shortcuts

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