"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LambdaSaturationWidget = void 0;
const aws_cdk_lib_1 = require("aws-cdk-lib");
const lambda_search_1 = require("../../metrics/lambda-search");
class LambdaSaturationWidget extends aws_cdk_lib_1.aws_cloudwatch.GraphWidget {
    constructor(props) {
        const { lambdaNames } = props;
        super({
            title: 'Lambda Saturation',
            width: 6,
            height: 4,
            left: lambdaNames.map((lambda) => new lambda_search_1.LambdaSearchConcurrencyMetric({ lambdaSearchName: lambda })),
            right: lambdaNames.map((lambda) => new lambda_search_1.LambdaSearchThrottlesMetric({ lambdaSearchName: lambda })),
            legendPosition: aws_cdk_lib_1.aws_cloudwatch.LegendPosition.HIDDEN,
            leftAnnotations: [{ label: 'Concurrency Limit', value: 1000 }],
            leftYAxis: { label: 'Concurrent Executions', showUnits: false },
            rightYAxis: { label: 'Throttles', showUnits: false },
        });
    }
}
exports.LambdaSaturationWidget = LambdaSaturationWidget;
