import type { TraceProcessorService } from './traceProcessorService';
export interface SegmentInput {
    utid: number;
    tid: number | null;
    upid: number | null;
    startTs: number;
    endTs: number;
    state?: string | null;
}
export type SemanticSourceStatus = 'present' | 'empty' | 'stdlib_missing' | 'sql_error' | 'skipped';
export interface BinderTxnSummary {
    binderTxnId: number | null;
    binderReplyId: number | null;
    side: 'client' | 'server' | 'both';
    interfaceName: string | null;
    methodName: string | null;
    isSync: boolean | null;
    isMainThread: boolean | null;
    clientProcess: string | null;
    clientThread: string | null;
    serverProcess: string | null;
    serverThread: string | null;
    clientUtid: number | null;
    serverUtid: number | null;
    clientTid: number | null;
    serverTid: number | null;
    durMs: number;
}
export interface MonitorContentionSummary {
    rowId: number;
    shortBlockedMethod: string | null;
    shortBlockingMethod: string | null;
    blockedThreadName: string | null;
    blockingThreadName: string | null;
    blockedTid: number | null;
    blockingTid: number | null;
    blockedUtid: number | null;
    blockingUtid: number | null;
    durMs: number;
    isBlockedThreadMain: boolean | null;
}
export interface IoSignal {
    source: 'io_wait_flag' | 'blocked_function';
    blockedFunction: string | null;
    durMs: number;
    ioWait: boolean;
}
export interface GcEventSummary {
    gcType: string | null;
    isMarkCompact: boolean | null;
    reclaimedMb: number | null;
    durMs: number;
    thread: string | null;
    process: string | null;
}
export interface CpuCompetitionSummary {
    cpu: number;
    competingTid: number | null;
    competingUtid: number | null;
    competingThread: string | null;
    competingProcess: string | null;
    competingState: string | null;
    competingDurMs: number;
    cpuMaxFreqKhz: number | null;
}
export interface SegmentSemantics {
    segmentKey: string;
    binderTxns: BinderTxnSummary[];
    monitorContention: MonitorContentionSummary[];
    ioSignals: IoSignal[];
    gcEvents: GcEventSummary[];
    cpuCompetition: CpuCompetitionSummary[];
    sources: {
        binder: SemanticSourceStatus;
        monitor: SemanticSourceStatus;
        io: SemanticSourceStatus;
        gc: SemanticSourceStatus;
        cpu: SemanticSourceStatus;
    };
    warnings: string[];
}
declare function classifyError(error: unknown): {
    status: SemanticSourceStatus;
    warning: string;
};
declare function segmentKeyOf(segment: SegmentInput): string;
declare function buildSegmentValuesCte(segments: SegmentInput[]): string;
export declare function enrichSegmentsWithSemantics(tp: TraceProcessorService, traceId: string, segments: SegmentInput[]): Promise<Map<string, SegmentSemantics>>;
export declare const __INTERNAL__: {
    classifyError: typeof classifyError;
    segmentKeyOf: typeof segmentKeyOf;
    buildSegmentValuesCte: typeof buildSegmentValuesCte;
};
export {};
//# sourceMappingURL=criticalPathSemantics.d.ts.map