"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphqlApiRequestsMetric = void 0;
const aws_cdk_lib_1 = require("aws-cdk-lib");
const _1 = require(".");
class GraphqlApiRequestsMetric extends aws_cdk_lib_1.aws_cloudwatch.Metric {
    constructor(props) {
        var _a;
        // There is no direct request count metric. Have to get this from the sample
        // count for one of the other metrics.
        // https://docs.aws.amazon.com/appsync/latest/devguide/monitoring.html#cw-metrics
        super((0, _1.graphqlApiMetricPropsToMetricProps)(props, 'Latency', (_a = props.label) !== null && _a !== void 0 ? _a : 'Requests', aws_cdk_lib_1.aws_cloudwatch.Statistic.SAMPLE_COUNT));
    }
}
exports.GraphqlApiRequestsMetric = GraphqlApiRequestsMetric;
