Documentation ¶
Index ¶
- Variables
- func Accuracy(v float64, accuracy int32) float64
- func ByteToGibibyte(v uint64, accuracy int32) float64
- func CoreToMillcore(v float64) uint64
- func GibibyteToByte(v float64) uint64
- func MillcoreToCore(v uint64, accuracy int32) float64
- func ResourceToString(res float64, typ string) string
- func WorkspaceString(workspace Workspace) string
- func WorkspacesString(workspaces []Workspace) []string
- type Calculator
- func (c *Calculator) AddValue(cpu, mem uint64, workspace ...Workspace)
- func (c *Calculator) AllocatableCPU(workspace Workspace) uint64
- func (c *Calculator) AllocatableMem(workspace Workspace) uint64
- func (c *Calculator) AlreadyTookUpCPU(workspace Workspace) uint64
- func (c *Calculator) AlreadyTookUpMem(workspace Workspace) uint64
- func (c *Calculator) DeductionQuota(workspace Workspace, cpu, mem uint64)
- func (c *Calculator) QuotableCPUForWorkspace(workspace Workspace) uint64
- func (c *Calculator) QuotableMemForWorkspace(workspace Workspace) uint64
- func (c *Calculator) TotalQuotableCPU() uint64
- func (c *Calculator) TotalQuotableMem() uint64
- type ResourceCalculator
- type Workspace
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ByteToGibibyte ¶
func CoreToMillcore ¶
func GibibyteToByte ¶
func MillcoreToCore ¶
func ResourceToString ¶
func WorkspaceString ¶
func WorkspacesString ¶
Types ¶
type Calculator ¶
type Calculator struct { ClusterName string // contains filtered or unexported fields }
func New ¶
func New(clusterName string) *Calculator
func (*Calculator) AddValue ¶
func (c *Calculator) AddValue(cpu, mem uint64, workspace ...Workspace)
func (*Calculator) AllocatableCPU ¶
func (c *Calculator) AllocatableCPU(workspace Workspace) uint64
func (*Calculator) AllocatableMem ¶
func (c *Calculator) AllocatableMem(workspace Workspace) uint64
func (*Calculator) AlreadyTookUpCPU ¶
func (c *Calculator) AlreadyTookUpCPU(workspace Workspace) uint64
func (*Calculator) AlreadyTookUpMem ¶
func (c *Calculator) AlreadyTookUpMem(workspace Workspace) uint64
func (*Calculator) DeductionQuota ¶
func (c *Calculator) DeductionQuota(workspace Workspace, cpu, mem uint64)
func (*Calculator) QuotableCPUForWorkspace ¶
func (c *Calculator) QuotableCPUForWorkspace(workspace Workspace) uint64
func (*Calculator) QuotableMemForWorkspace ¶
func (c *Calculator) QuotableMemForWorkspace(workspace Workspace) uint64
func (*Calculator) TotalQuotableCPU ¶
func (c *Calculator) TotalQuotableCPU() uint64
func (*Calculator) TotalQuotableMem ¶
func (c *Calculator) TotalQuotableMem() uint64
type ResourceCalculator ¶
Click to show internal directories.
Click to hide internal directories.