footprint

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package footprint provides data and functions to estimate the carbon emissions of AWS EC2 instance operation.

Data source: https://docs.google.com/spreadsheets/d/1DqYgQnEDLQVQm5acMAhLgHLD8xXCG9BIrk-_Nv6jF3k/edit#gid=504755275 Data and methodology provided by Teads engineering, under the Creative Commons Attribution 4.0 International License.

Data snapshot date: 2022-08-17

More background on the methodology: https://medium.com/teads-engineering/building-an-aws-ec2-carbon-emissions-dataset-3f0fd76c98ac

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWS

func AWS(regionCode, instanceType string, duration time.Duration) (float64, error)

AWS returns the footprint in gram CO2 equivalents

func CarbonIntensity

func CarbonIntensity(regionCode string) (float64, error)

CarbonIntensity returns the carbon intensity for an AWS region. The return value is the number of grams of CO2 emitted while producing one kilowatt hour of electricity for the data center.

func ManufacturingEmissions

func ManufacturingEmissions(ec2InstanceType string) (float64, error)

ManufacturingEmissions returns manufacturing emissions for a machine, as an hourly contribution to emissions in grams.

func PUE

func PUE(regionCode string) (float64, error)

PUE returns the power usage effectiveness coefficient for an AWS region. See https://en.wikipedia.org/wiki/Power_usage_effectiveness for details.

func PowerAt50Percent

func PowerAt50Percent(ec2InstanceType string) (float64, error)

PowerAt50Percent returns the power consumption at 50% load for an EC2 instance type, in watt.

Types

type AWSRegion

type AWSRegion struct {
	// CarbonIntensity is the amount of CO2 emitted when producing electricity.
	// Unit: metric gram per kilowatt hour.
	CarbonIntensity float64

	// PUE is the power usage effectiveness coefficient of the data center.
	// See https://en.wikipedia.org/wiki/Power_usage_effectiveness for details.
	PUE float64
}

type EC2Instance

type EC2Instance struct {
	// WattAt50Percent is the instance power consumtion in Watt at 50% load
	PowerAt50Percent float64

	// ManufacturingEmissionsHourly is the emissions created during production of the
	// hardware, calculated as contribution to the hourly footprint, in metric grams CO2e.
	ManufacturingEmissionsHourly float64
}

Jump to

Keyboard shortcuts

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