"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CloudfrontErrorsWidget = void 0;
const aws_cdk_lib_1 = require("aws-cdk-lib");
const error_rates_1 = require("../../metrics/cloudfront/error-rates");
class CloudfrontErrorsWidget extends aws_cdk_lib_1.aws_cloudwatch.GraphWidget {
    constructor(props) {
        const { distributionId } = props;
        const errors = new error_rates_1.CloudfrontErrorRatesMetric({ distributionId });
        super({
            title: 'Errors',
            width: 24,
            height: 4,
            left: [errors.rate4xx, errors.rate5xx],
            leftYAxis: { min: 0, max: 100 },
        });
    }
}
exports.CloudfrontErrorsWidget = CloudfrontErrorsWidget;
