"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiLatencyWidget = void 0;
const latency_1 = require("../../metrics/api-gateway/latency");
const aws_cdk_lib_1 = require("aws-cdk-lib");
class ApiLatencyWidget extends aws_cdk_lib_1.aws_cloudwatch.GraphWidget {
    constructor(props) {
        const { apiName, stage, percentile, horizontalAnnotations } = props;
        super({
            title: `Latency P${percentile}`,
            width: 6,
            height: 4,
            left: [new latency_1.ApiGatewayLatencyMetric({ apiName, stage }, percentile)],
            legendPosition: aws_cdk_lib_1.aws_cloudwatch.LegendPosition.HIDDEN,
            leftAnnotations: horizontalAnnotations !== null && horizontalAnnotations !== void 0 ? horizontalAnnotations : [],
            leftYAxis: { label: 'Milliseconds', showUnits: false },
        });
    }
}
exports.ApiLatencyWidget = ApiLatencyWidget;
