/**
 * Statistics operations for DatabaseService
 *
 * Handles database statistics retrieval.
 */
import Database from 'better-sqlite3';
import { DatabaseStats } from './types.js';
/**
 * Get database statistics
 *
 * @param db - Database connection
 * @param name - Database name
 * @param path - Database file path
 * @returns DatabaseStats - Live statistics from database
 */
export declare function getStats(db: Database.Database, name: string, path: string): DatabaseStats;
/**
 * Update metadata counts from actual table counts
 *
 * @param db - Database connection
 */
export declare function updateMetadataCounts(db: Database.Database): void;
/**
 * Update metadata last_modified_at timestamp
 *
 * @param db - Database connection
 */
export declare function updateMetadataModified(db: Database.Database): void;
export type TimelineBucket = 'hourly' | 'daily' | 'weekly' | 'monthly';
export type TimelineMetric = 'documents' | 'pages' | 'chunks' | 'embeddings' | 'images' | 'cost';
export interface TimelineStatsOptions {
    bucket: TimelineBucket;
    metric: TimelineMetric;
    created_after?: string;
    created_before?: string;
}
export interface TimelineDataPoint {
    period: string;
    count: number;
    total?: number;
}
/**
 * Get processing volume over time buckets for various metrics.
 *
 * @param db - Database connection
 * @param options - Bucket type, metric, optional date range
 * @returns Array of { period, count, total? } data points
 */
export declare function getTimelineStats(db: Database.Database, options: TimelineStatsOptions): TimelineDataPoint[];
export interface QualityTrendOptions {
    bucket: TimelineBucket;
    group_by?: 'none' | 'ocr_mode' | 'processor';
    created_after?: string;
    created_before?: string;
}
export interface QualityTrendDataPoint {
    period: string;
    avg_quality: number;
    min_quality: number;
    max_quality: number;
    sample_count: number;
    group?: string;
}
/**
 * Get quality score trends over time, optionally grouped by OCR mode or processor.
 *
 * Uses ocr_results.parse_quality_score for ocr_mode grouping,
 * and provenance.processing_quality_score for processor grouping.
 *
 * @param db - Database connection
 * @param options - Bucket type, group_by, optional date range
 * @returns Array of quality trend data points
 */
export declare function getQualityTrends(db: Database.Database, options: QualityTrendOptions): QualityTrendDataPoint[];
export interface ThroughputOptions {
    bucket: TimelineBucket;
    created_after?: string;
    created_before?: string;
}
export interface ThroughputDataPoint {
    period: string;
    pages_processed: number;
    embeddings_generated: number;
    images_processed: number;
    total_ocr_duration_ms: number;
    total_embedding_duration_ms: number;
    avg_ms_per_page: number;
    avg_ms_per_embedding: number;
}
/**
 * Get processing throughput metrics per time bucket.
 *
 * Queries provenance table for OCR_RESULT, EMBEDDING, and IMAGE types
 * to compute per-bucket throughput rates.
 *
 * @param db - Database connection
 * @param options - Bucket type, optional date range
 * @returns Array of throughput data points per bucket
 */
export declare function getThroughputAnalytics(db: Database.Database, options: ThroughputOptions): ThroughputDataPoint[];
//# sourceMappingURL=stats-operations.d.ts.map