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