v1

package
v0.0.1-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataPath string = fmt.Sprintf("%s/data/v1", repoPath)

Functions

func CloneAndUpdateFactorsData

func CloneAndUpdateFactorsData() error

CloneAndUpdateFactorsData wraps the CloneAndUpdateRepo function with private variables passed.

func CloneAndUpdateRepo

func CloneAndUpdateRepo(repoPath, repoURL string) error

CloneAndUpdateRepo checks if a local repo exists and is up to date with origin. Otherwise, it deletes and clones it to the repoPath.

Types

type Coefficient

type Coefficient struct {
	Region string
	Co2e   float64
}

type CoefficientData

type CoefficientData map[string]float64 // map[region] = co2e

type Embodied

type Embodied struct {
	MachineType                   string  `yaml:"type"`
	AdditionalMemoryKiloWattCO2e  float64 `yaml:"additionalmemory"`
	AdditionalStorageKiloWattCO2e float64 `yaml:"additionalstorage"`
	AdditionalCPUsKiloWattCO2e    float64 `yaml:"additionalcpus"`
	AdditionalGPUsKiloWattCO2e    float64 `yaml:"additionalgpus"`
	TotalEmbodiedKiloWattCO2e     float64 `yaml:"total"`
	VCPU                          float64 `yaml:"vCPU"`      // vCPU count for instance Type
	TotalVCPU                     float64 `yaml:"totalVCPU"` // Highest amount of vCPUs in machine type family
	Architecture                  string
	MachineSpecs
}

TODO: Need to add machine lifespan for embodied carbon

type EmbodiedData

type EmbodiedData map[string]Embodied // key = Machine type (n2-standard-

type EmissionFactors

type EmissionFactors struct {
	Provider    v1.Provider
	Coefficient CoefficientData // key is region
	Embodied    EmbodiedData    // key is machineType
	*ProviderDefaults
}

func ProviderEmissions

func ProviderEmissions(provider v1.Provider, dataPath string) (*EmissionFactors, error)

ProviderEmissions reads in emission data for a specified provider and stores them into the emissionFactors struct for calulating

type MachineSpecs

type MachineSpecs struct {
	Architecture string
	MinWatts     float64
	MaxWatts     float64
	GBPerChip    float64 `yaml:"chip"`
}

type MachineSpecsData

type MachineSpecsData map[string]MachineSpecs // key = architecture name (Haswell, Skylake, ..)

type ProviderDefaults

type ProviderDefaults struct {
	Provider                 string  `yaml:"name"`
	MinWatts                 float64 `yaml:"minWatts"`
	MaxWatts                 float64 `yaml:"maxWatts"`
	HDDStorageWatts          float64 `yaml:"hddStorageWatts"`
	SSDStorageWatts          float64 `yaml:"ssdStorageWatts"`
	NetworkingKilloWattHours float64 `yaml:"networkingKilloWattHours"`
	MemoryKilloWattHours     float64 `yaml:"memoryKilloWattHours"`
	AveragePUE               float64 `yaml:"averagePUE"`
}

Jump to

Keyboard shortcuts

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