@cloud-carbon-footprint/aws
Version:
The core logic to get cloud usage data and estimate energy and carbon emissions from Amazon Web Services.
213 lines • 11.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AWS_EMISSIONS_FACTORS_METRIC_TON_PER_KWH = exports.AWS_CLOUD_CONSTANTS = void 0;
const core_1 = require("@cloud-carbon-footprint/core");
const AWSRegions_1 = require("../lib/AWSRegions");
exports.AWS_CLOUD_CONSTANTS = {
SSDCOEFFICIENT: 1.2,
HDDCOEFFICIENT: 0.65,
MEMORY_AVG: 80.69,
MEMORY_BY_COMPUTE_PROCESSOR: {
[]: 69.65,
[]: 105.97,
[]: 19.56,
[]: 92.44,
[]: 129.78,
[]: 137.14,
[]: 152.2,
[]: 74.62,
[]: 160,
[]: 221.14,
[]: 129.78,
[]: 129.78,
[]: 129.78,
[]: 129.78,
[]: 31.06,
[]: 136,
[]: 13.33,
[]: 17.07,
[]: 130.8,
[]: 75.1,
},
getMemory: (computeProcessors) => {
const memoryForProcessors = computeProcessors.map((processor) => {
return exports.AWS_CLOUD_CONSTANTS.MEMORY_BY_COMPUTE_PROCESSOR[processor];
});
const averageMemoryForProcessors = (0, core_1.getAverage)(memoryForProcessors);
return averageMemoryForProcessors
? averageMemoryForProcessors
: exports.AWS_CLOUD_CONSTANTS.MEMORY_AVG;
},
MIN_WATTS_AVG: 0.74,
MIN_WATTS_BY_COMPUTE_PROCESSOR: {
[]: 6.8,
[]: 0.71,
[]: 0.69,
[]: 1.14,
[]: 0.85,
[]: 0.47,
[]: 0.46,
[]: 0.74,
[]: 3.68,
[]: 0.81,
[]: 0.58,
[]: 0.47,
[]: 0.47,
[]: 0.47,
[]: 0.47,
[]: 1.86,
[]: 0.77,
[]: 1.71,
[]: 2.21,
[]: 1.04,
[]: 0.61,
[]: 168,
[]: 120,
[]: 84,
[]: 84,
[]: 48,
[]: 72,
[]: 42,
[]: 8.64,
[]: 18,
[]: 8.4,
[]: 8.4,
[]: 27,
[]: 36,
[]: 30,
[]: 36,
[]: 36,
[]: 27,
},
getMinWatts: (computeProcessors) => {
const minWattsForProcessors = computeProcessors.map((processor) => {
return exports.AWS_CLOUD_CONSTANTS.MIN_WATTS_BY_COMPUTE_PROCESSOR[processor];
});
const averageWattsForProcessors = (0, core_1.getWattsByAverageOrMedian)(computeProcessors, minWattsForProcessors);
return averageWattsForProcessors
? averageWattsForProcessors
: exports.AWS_CLOUD_CONSTANTS.MIN_WATTS_AVG;
},
MAX_WATTS_AVG: 3.5,
MAX_WATTS_BY_COMPUTE_PROCESSOR: {
[]: 39,
[]: 3.69,
[]: 4.06,
[]: 5.42,
[]: 2.6,
[]: 1.69,
[]: 1.96,
[]: 2.28,
[]: 8.96,
[]: 4.48,
[]: 2.53,
[]: 1.69,
[]: 1.69,
[]: 1.69,
[]: 1.69,
[]: 5.6,
[]: 3.76,
[]: 5.56,
[]: 8.63,
[]: 4.16,
[]: 4.1,
[]: 1428,
[]: 1020,
[]: 714,
[]: 714,
[]: 408,
[]: 612,
[]: 357,
[]: 73.44,
[]: 153,
[]: 71.4,
[]: 71.4,
[]: 229.5,
[]: 306,
[]: 255,
[]: 306,
[]: 306,
[]: 229.5,
},
getMaxWatts: (computeProcessors) => {
const maxWattsForProcessors = computeProcessors.map((processor) => {
return exports.AWS_CLOUD_CONSTANTS.MAX_WATTS_BY_COMPUTE_PROCESSOR[processor];
});
const averageWattsForProcessors = (0, core_1.getWattsByAverageOrMedian)(computeProcessors, maxWattsForProcessors);
return averageWattsForProcessors
? averageWattsForProcessors
: exports.AWS_CLOUD_CONSTANTS.MAX_WATTS_AVG;
},
NETWORKING_COEFFICIENT: 0.001,
MEMORY_COEFFICIENT: 0.000392,
PUE_AVG: 1.135,
getPUE: () => {
return exports.AWS_CLOUD_CONSTANTS.PUE_AVG;
},
AVG_CPU_UTILIZATION_2020: 50,
REPLICATION_FACTORS: {
S3: 6,
S3_ONE_ZONE_REDUCED_REDUNDANCY: 2,
EC2_EBS_VOLUME: 2,
EC2_EBS_SNAPSHOT: 3,
EFS: 3,
EFS_ONE_ZONE: 2,
RDS_BACKUP: 3,
RDS_AURORA: 6,
RDS_MULTI_AZ: 2,
DOCUMENT_DB_BACKUP: 3,
DOCUMENT_DB_STORAGE: 2,
DYNAMO_DB: 2,
ECR_STORAGE: 3,
DOCUMENT_ELASTICACHE_BACKUP: 3,
SIMPLE_DB: 2,
DEFAULT: 1,
},
KILOWATT_HOURS_BY_SERVICE_AND_USAGE_UNIT: {
total: {},
},
ESTIMATE_UNKNOWN_USAGE_BY: core_1.EstimateUnknownUsageBy.COST,
SERVER_EXPECTED_LIFESPAN: 35040,
};
exports.AWS_EMISSIONS_FACTORS_METRIC_TON_PER_KWH = {
[]: core_1.US_NERC_REGIONS_EMISSIONS_FACTORS.SERC,
[]: core_1.US_NERC_REGIONS_EMISSIONS_FACTORS.RFC,
[]: core_1.US_NERC_REGIONS_EMISSIONS_FACTORS.WECC,
[]: core_1.US_NERC_REGIONS_EMISSIONS_FACTORS.WECC,
[]: core_1.US_NERC_REGIONS_EMISSIONS_FACTORS.SERC,
[]: core_1.US_NERC_REGIONS_EMISSIONS_FACTORS.WECC,
[]: 0.00075744,
[]: 0.00067348,
[]: 0.00064142,
[]: 0.00095182,
[]: 0.00095182,
[]: 0.00043984,
[]: 0.00047739,
[]: 0.00043984,
[]: 0.00049453,
[]: 0.00058023,
[]: 0.00071767,
[]: 0.00058023,
[]: 0.00062051,
[]: 0.00007939,
[]: 0.00050824,
[]: 0.00011541,
[]: 0.00011541,
[]: 0.0005374,
[]: 0.0005374,
[]: 0.000368,
[]: 0.000368,
[]: 0.000305,
[]: 0.000305,
[]: 0.000074,
[]: 0.000297,
[]: 0.000178,
[]: 0.000008,
[]: 0.00053982,
[]: 0.00050549,
[]: 0.0003652,
[]: 0.00041896,
[]: 0.00006398,
[]: 0.0004215330139,
};
//# sourceMappingURL=AwsFootprintEstimationConstants.js.map