/** * Fixed bucket boundaries in milliseconds, roughly 2-3x steps. Fixed rather than * configurable because two ranges holding different layouts cannot be merged into one * percentile without layout versioning, and the merge is what makes multi-day queries work. * * The tail past 10 minutes exists for wait time, where a stalled queue genuinely sits for * hours. Without it p99 wait collapses to "over 10 minutes" exactly when it needs to be * actionable. */ export declare const BUCKET_BOUNDS: number[]; /** One bucket per bound, plus a final overflow bucket for anything past the last bound. */ export declare const BUCKET_COUNT: number; export declare function bucketIndex(ms: number): number; export declare function emptyVector(): number[]; export declare function packVector(vector: number[]): string; export declare function unpackVector(raw: string | null): number[]; export declare function mergeVectors(a: number[], b: number[]): number[]; export declare function vectorTotal(vector: number[]): number; /** * Prometheus-style histogram_quantile: find the bucket holding the rank, then interpolate * linearly across that bucket's span. The result is an estimate bounded by bucket width, * never more precise than the layout allows. * * Samples in the overflow bucket have no upper bound to interpolate towards, so they report * the last finite bound rather than inventing a ceiling. */ export declare function quantile(vector: number[], p: number): number;