UNPKG

@cloud-carbon-footprint/core

Version:

The core logic to get cloud usage data and estimate energy and carbon emissions.

27 lines 934 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HDDStorageService = exports.SSDStorageService = void 0; const _1 = require("."); class StorageService { constructor(storageCoefficient) { this.estimator = new _1.StorageEstimator(storageCoefficient); } async getEstimates(start, end, region, emissionsFactors, constants) { const usage = await this.getUsage(start, end, region); return this.estimator.estimate(usage, region, emissionsFactors, constants); } } exports.default = StorageService; class SSDStorageService extends StorageService { constructor(coefficient) { super(coefficient); } } exports.SSDStorageService = SSDStorageService; class HDDStorageService extends StorageService { constructor(coefficient) { super(coefficient); } } exports.HDDStorageService = HDDStorageService; //# sourceMappingURL=StorageService.js.map