comparer

package
v0.0.0-...-5a7ebb4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DieOnError

func DieOnError(err error, msg string)

func GetHTMLReportPath

func GetHTMLReportPath(outDir, clusterName string, reportSuffix string) string

func UnmarshallReport

func UnmarshallReport(path string) (gsh.Scenario, error)

Types

type Config

type Config struct {
	CAReportPath string
	SRReportPath string
	Provider     string
	ReportOutDir string
}

type HTMLPageData

type HTMLPageData struct {
	Title               string
	ClusterName         string
	Provider            string
	CASettings          gsc.CASettingsInfo
	UnscheduledPodCount int
	NodeGroups          []gsc.NodeGroupInfo
	CAScaleUpRows       []ScalingRow
	SRScaleUpRows       []ScalingRow
	TotalCosts          TotalCosts
}

type Result

type Result struct {
	MDReportPath   string
	HTMLReportPath string
}

func GenerateReport

func GenerateReport(pa pricing.InstancePricingAccess, provider, clusterName, reportSuffix string, reportOutDir string,
	caScenario, srScenario gsh.Scenario) (res Result, err error)

func GenerateReportFromConfig

func GenerateReportFromConfig(c Config) (res Result, err error)

type ScalingRow

type ScalingRow struct {
	Name         string
	Count        int
	InstanceType string
	Cost         string
	CPU          string
	Memory       string
}

rows = append(rows, []string{ng, fmt.Sprint(count), instanceType, fmt.Sprintf("$%.2f", cost), cpu.String(), fmt.Sprintf("%.2f GiB", float64(memory.Value())/1024/1024/1024)})

type TotalCosts

type TotalCosts struct {
	VirtualCA          float64
	ScalingRecommender float64
	Savings            float64
}

Jump to

Keyboard shortcuts

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