export type FilterParams = {
    timeLimit: {
        start: string;
        end: string;
    };
    projectId: string;
    applicationId: string;
};
export declare class FunctionalChartsService {
    private static instance;
    private constructor();
    static getInstance(): FunctionalChartsService;
    private isNotEmpty;
    private buildTestRunConditions;
    /** Choose bucket unit from time range (aligned with observeCharts). */
    private getBucketUnit;
    private floorToDayUtc;
    private floorToWeekUtc;
    private floorToMonthUtc;
    private floorToBucketUtc;
    /** Format date as yyyy-MM-dd using UTC (for bucket keys). */
    private formatUtcDate;
    private addBucketUtc;
    /** Build ordered bucket keys (yyyy-MM-dd, UTC) for the range. */
    private buildBucketKeys;
    /**
     * Single query: test_runs -> test_runs_to_evals -> eval_results.
     * Returns rows with gradingResult and test run id/createdAt for scoping.
     */
    private getFunctionalEvalResultRows;
    /**
     * Stats: evaluations_completed = count of completed EVAL test runs (matches getWorkspaceDetails functionEvalCount).
     * total_requests / total_success / total_failures = test case counts from eval_results (one row = one test case, success from eval_results.success).
     * Logic aligned with getTestRunMetricsGraph.
     */
    getFunctionalTestStats(params: FilterParams): Promise<{
        evaluations_completed: number;
        total_requests: number;
        total_success: number;
        total_failures: number;
        total_errors: number;
    }>;
    /**
     * Trend = count of completed EVAL test runs per bucket (day/week/month by range). One query on test_runs only.
     */
    getFunctionalEvaluationsTrend(params: FilterParams): Promise<Array<{
        timestamp: string;
        count: number;
    }>>;
    /**
     * Recent completed EVAL test runs with status. One joined query, then dedupe test runs in JS.
     */
    getRecentFunctionalEvaluations(params: FilterParams & {
        limit?: number;
    }): Promise<{
        id: string;
        createdAt: Date | null;
        status: string;
    }[]>;
    /**
     * Test case results over time. Logic aligned with getTestRunMetricsGraph:
     * eval IDs from test runs -> eval_results (success) -> attribute to test run bucket (day/week/month by range).
     * Returns graph data for stacked bar chart: { date, total, pass, fail, error } per bucket.
     */
    getTestCaseResultsOverTime(params: FilterParams): Promise<Array<{
        date: string;
        total: number;
        pass: number;
        fail: number;
        error: number;
    }>>;
    /**
     * Top metric failures. One joined query, aggregate by type in JS.
     */
    getTopMetricFailures(params: FilterParams): Promise<Array<{
        type: string;
        successCount: number;
        failureCount: number;
        errorCount: number;
        avgScore: number;
    }>>;
}
export declare const functionalChartsService: FunctionalChartsService;
//# sourceMappingURL=functionalChartsService.d.ts.map