var AggregationType;
(function (AggregationType) {
    AggregationType["Max"] = "Max";
    AggregationType["Min"] = "Min";
    AggregationType["Sum"] = "Sum";
    AggregationType["Avg"] = "Avg";
    AggregationType["Count"] = "Count";
    /*
     * Percentile aggregations. For Metric (the only model that carries
     * histogram bucket data), MetricService overrides the aggregate path to
     * fan out histogram buckets into weighted samples and use
     * quantileExactWeighted, so a P95 of an `http.server.request.duration`
     * histogram returns the bucket-derived 95th percentile rather than the
     * 95th percentile of the per-row `sum`. For other models (Span, Log,
     * etc.) the StatementGenerator falls back to ClickHouse's `quantile(p)`
     * over the raw column, which is the right thing for scalar columns.
     */
    AggregationType["P50"] = "P50";
    AggregationType["P90"] = "P90";
    AggregationType["P95"] = "P95";
    AggregationType["P99"] = "P99";
})(AggregationType || (AggregationType = {}));
export default AggregationType;
export const PercentileAggregationLevels = {
    [AggregationType.P50]: 0.5,
    [AggregationType.P90]: 0.9,
    [AggregationType.P95]: 0.95,
    [AggregationType.P99]: 0.99,
};
export function isPercentileAggregation(type) {
    return Object.prototype.hasOwnProperty.call(PercentileAggregationLevels, type);
}
export function getPercentileLevel(type) {
    var _a;
    if (!isPercentileAggregation(type)) {
        return null;
    }
    return (_a = PercentileAggregationLevels[type]) !== null && _a !== void 0 ? _a : null;
}
//# sourceMappingURL=AggregationType.js.map