models

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Name                           string
	RequestedCPUMillicore          int
	RequestedMemoryMegaByte        int
	RequestedCPUPercentageOfRun    float64
	RequestedMemoryPercentageOfRun float64
}

type ApplicationCost

type ApplicationCost struct {
	Name                   string
	WBS                    string
	CostPercentageByCPU    float64
	CostPercentageByMemory float64
}

type Cost

type Cost struct {
	From         time.Time
	To           time.Time
	Applications []ApplicationCost
	// contains filtered or unexported fields
}

Cost holds cost information between from and to time

func NewCost

func NewCost(from, to time.Time, runs []Run) Cost

NewCost aggregate cost over a time period for applications

func (Cost) GetCostBy

func (cost Cost) GetCostBy(appName string) *ApplicationCost

GetCostBy returns application by appName

type RequiredResources

type RequiredResources struct {
	ID              int64
	WBS             string
	Application     string
	Environment     string
	Component       string
	CPUMillicore    int
	MemoryMegaBytes int
	Replicas        int
}

RequiredResources holds required resources for a single component

type Run

type Run struct {
	ID                    int64
	MeasuredTimeUTC       time.Time
	ClusterCPUMillicore   int
	ClusterMemoryMegaByte int
	Resources             []RequiredResources
}

Run holds all required resources for a time

func (Run) CPUWeightInPeriod

func (run Run) CPUWeightInPeriod(totalRequestedCPUForPeriod int) float64

CPUWeightInPeriod weight of a run for a period

func (Run) GetApplicationsRequiredResource

func (run Run) GetApplicationsRequiredResource() []Application

GetApplicationsRequiredResource returns resource requested aggregated on application

func (Run) MemoryWeightInPeriod

func (run Run) MemoryWeightInPeriod(totalRequestedMemoryForPeriod int) float64

MemoryWeightInPeriod weight of a run for a period

func (Run) RequestedCPUByApplications

func (run Run) RequestedCPUByApplications() int

RequestedCPUByApplications total requested cpu by applications for a run

func (Run) RequestedMemoryByApplications

func (run Run) RequestedMemoryByApplications() int

RequestedMemoryByApplications total requested memory by applications for a run

Jump to

Keyboard shortcuts

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