calculator

package
v0.0.0-...-d0a74a8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ARM_TYPE_PREFIX = "t2a-"
View Source
const CLUSTER_FEE = 0.1

Variables

This section is empty.

Functions

func ValidateAndRoundResources

func ValidateAndRoundResources(mCPU int64, memory int64, storage int64) (int64, int64, int64)

Types

type PriceList

type PriceList struct {
	// generic for all
	Region       string
	StoragePrice float64

	// regular pricing
	CpuPrice               float64
	MemoryPrice            float64
	CpuBalancedPrice       float64
	MemoryBalancedPrice    float64
	CpuScaleoutPrice       float64
	MemoryScaleoutPrice    float64
	CpuArmScaleoutPrice    float64
	MemoryArmScaleoutPrice float64

	// spot pricing
	SpotCpuPrice               float64
	SpotMemoryPrice            float64
	SpotCpuBalancedPrice       float64
	SpotMemoryBalancedPrice    float64
	SpotCpuScaleoutPrice       float64
	SpotMemoryScaleoutPrice    float64
	SpotArmCpuScaleoutPrice    float64
	SpotArmMemoryScaleoutPrice float64
}

func GetAutopilotPricing

func GetAutopilotPricing(sku string, region string) (PriceList, error)

type PricingService

type PricingService struct {
	Pricing PriceList
	Config  *ini.File
	// contains filtered or unexported fields
}

func NewService

func NewService(sku string, region string, clientset *kubernetes.Clientset, metricsClientset *metricsv.Clientset, config *ini.File) (*PricingService, error)

func (*PricingService) CalculatePricing

func (service *PricingService) CalculatePricing(cpu int64, memory int64, storage int64, class cluster.ComputeClass, spot bool) float64

func (*PricingService) DecideComputeClass

func (service *PricingService) DecideComputeClass(workloadName string, mCPU int64, memory int64, arm64 bool) cluster.ComputeClass

func (*PricingService) PopulateWorkloads

func (service *PricingService) PopulateWorkloads(nodes map[string]cluster.Node) ([]cluster.Workload, error)

Jump to

Keyboard shortcuts

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