/**
 * 帧率统计分析模板
 * 分析应用的帧率性能：FPS、掉帧、P95/P99延迟等
 */
import { TraceProcessorService } from '../traceProcessorService';
export interface FrameStatsResult {
    summary: {
        totalFrames: number;
        avgFps: number;
        jankCount: number;
        jankPercentage: number;
        avgFrameDurationMs: number;
    };
    percentiles: {
        p50Ms: number;
        p90Ms: number;
        p95Ms: number;
        p99Ms: number;
        maxMs: number;
    };
    jankFrames: {
        timestamp: number;
        durationMs: number;
        vsyncsMissed: number;
    }[];
    visualization: {
        type: 'histogram';
        data: {
            bucketStart: number;
            bucketEnd: number;
            count: number;
        }[];
    };
}
export interface FrameStatsAnalyzerConfig {
    /** Target frame time in milliseconds (default: derived from 60Hz) */
    targetFrameTimeMs?: number;
    /** Number of VSync periods missed before counting as jank (default: 2) */
    jankVsyncThreshold?: number;
    /** Detected VSync period in nanoseconds from trace metadata */
    detectedVsyncPeriodNs?: string | bigint | number;
    /** Device refresh rate in Hz from trace metadata */
    deviceRefreshRate?: number;
}
export declare class FrameStatsAnalyzer {
    private traceProcessor;
    /**
     * Target frame time in milliseconds.
     * Derived from the configured VSync period (default 60Hz = 16.67ms).
     */
    private readonly targetFrameTimeMs;
    /**
     * Jank threshold in milliseconds.
     * Default: 2 * targetFrameTimeMs (missing 2+ VSyncs = jank).
     */
    private readonly jankThresholdMs;
    constructor(traceProcessor: TraceProcessorService, config?: FrameStatsAnalyzerConfig);
    /**
     * 执行帧率统计分析
     * @param traceId Trace ID
     * @param packageName 应用包名，可选
     * @param startTs 开始时间戳（纳秒），可选
     * @param endTs 结束时间戳（纳秒），可选
     */
    analyze(traceId: string, packageName?: string, startTs?: number, endTs?: number): Promise<FrameStatsResult>;
    /**
     * 简化版分析：基于 slice 表（适用于没有 actual_frame_timeline_slice 的trace）
     */
    analyzeFromSlices(traceId: string, processName: string, startTs?: number, endTs?: number): Promise<FrameStatsResult>;
    private getPercentile;
    private generateHistogram;
    private buildTimeCondition;
    private normalizeTimestamp;
    private escapeLikePattern;
    private resultToRows;
}
//# sourceMappingURL=frameStatsAnalysis.d.ts.map