export declare const TP_ADMISSION_CONTROL_ENV = "SMARTPERFETTO_TP_ADMISSION_CONTROL";
export declare const TP_RAM_BUDGET_BYTES_ENV = "SMARTPERFETTO_TP_RAM_BUDGET_BYTES";
export declare const TP_RAM_BUDGET_FACTOR_ENV = "SMARTPERFETTO_TP_RAM_BUDGET_FACTOR";
export declare const TP_ESTIMATE_MULTIPLIER_ENV = "SMARTPERFETTO_TP_ESTIMATE_MULTIPLIER";
export declare const TP_MIN_ESTIMATE_BYTES_ENV = "SMARTPERFETTO_TP_MIN_ESTIMATE_BYTES";
export declare const TP_OS_SAFETY_RESERVE_BYTES_ENV = "SMARTPERFETTO_TP_OS_SAFETY_RESERVE_BYTES";
export declare const TP_UPLOAD_RESERVE_BYTES_ENV = "SMARTPERFETTO_TP_UPLOAD_RESERVE_BYTES";
export interface TraceProcessorMemorySample {
    traceId?: string;
    rssBytes: number | null;
}
export interface TraceProcessorRamBudgetStats {
    enabled: boolean;
    totalMemoryBytes: number;
    nodeRssBytes: number;
    osSafetyReserveBytes: number;
    uploadReserveBytes: number;
    machineFactor: number;
    budgetBytes: number;
    observedProcessorRssBytes: number;
    availableForNewLeaseBytes: number;
    activeProcessorCount: number;
    unknownRssProcessorCount: number;
    estimateMultiplier: number;
    minEstimateBytes: number;
}
export interface TraceProcessorAdmissionDecision {
    admitted: boolean;
    traceId: string;
    traceSizeBytes: number;
    estimatedRssBytes: number;
    stats: TraceProcessorRamBudgetStats;
    reason?: string;
}
export declare function resolveTraceProcessorMachineFactor(totalMemoryBytes?: number, env?: NodeJS.ProcessEnv): number;
export declare function estimateTraceProcessorRssBytes(traceSizeBytes: number, env?: NodeJS.ProcessEnv): number;
export declare function traceProcessorAdmissionEnabled(env?: NodeJS.ProcessEnv): boolean;
export declare function getTraceProcessorRamBudgetStats(processors: TraceProcessorMemorySample[], env?: NodeJS.ProcessEnv): TraceProcessorRamBudgetStats;
export declare function decideTraceProcessorAdmission(input: {
    traceId: string;
    traceSizeBytes: number;
    processors: TraceProcessorMemorySample[];
    env?: NodeJS.ProcessEnv;
}): TraceProcessorAdmissionDecision;
export declare class TraceProcessorAdmissionError extends Error {
    readonly decision: TraceProcessorAdmissionDecision;
    constructor(decision: TraceProcessorAdmissionDecision);
}
export declare function assertTraceProcessorAdmission(input: {
    traceId: string;
    traceSizeBytes: number;
    processors: TraceProcessorMemorySample[];
    env?: NodeJS.ProcessEnv;
}): TraceProcessorAdmissionDecision;
//# sourceMappingURL=traceProcessorRamBudget.d.ts.map