@cloud-carbon-footprint/aws
Version:
The core logic to get cloud usage data and estimate energy and carbon emissions from Amazon Web Services.
18 lines (17 loc) • 765 B
TypeScript
import { ICloudService, FootprintEstimate, Cost } from '@cloud-carbon-footprint/core';
import { ServiceWrapper } from './ServiceWrapper';
export default class Lambda implements ICloudService {
private TIMEOUT;
private POLL_INTERVAL;
private readonly serviceWrapper;
private readonly LOG_GROUP_SIZE_REQUEST_LIMIT;
private readonly MAX_CONCURRENT_LOG_QUERIES;
serviceName: string;
constructor(TIMEOUT: number, POLL_INTERVAL: number, serviceWrapper: ServiceWrapper);
getEstimates(start: Date, end: Date, region: string): Promise<FootprintEstimate[]>;
private getQueryIdsArray;
private getLambdaLogGroupNames;
private runQuery;
private getResults;
getCosts(start: Date, end: Date, region: string): Promise<Cost[]>;
}