/**
 * Metrics Storage
 *
 * Stores and retrieves performance metrics with aggregation support.
 *
 * @since v1.70.0
 */
import type { AggregatedMetrics, AggregationPeriod, MetricsStorageConfig, PerformanceBaseline, PerformanceMetrics } from './analytics-types.js';
/**
 * Time range for queries
 */
export interface TimeRange {
    start: number;
    end: number;
}
/**
 * Metrics query options
 */
export interface MetricsQueryOptions {
    serverId?: string;
    range?: TimeRange;
    limit?: number;
    offset?: number;
}
/**
 * Metrics storage service
 */
export declare class MetricsStorage {
    private config;
    private rawMetrics;
    private hourlyAggregates;
    private dailyAggregates;
    private baselines;
    constructor(config?: Partial<MetricsStorageConfig>);
    /**
     * Store a metrics sample
     */
    store(metrics: PerformanceMetrics): void;
    /**
     * Get raw metrics
     */
    getRaw(options?: MetricsQueryOptions): PerformanceMetrics[];
    /**
     * Get latest metrics for a server
     */
    getLatest(serverId: string): PerformanceMetrics | undefined;
    /**
     * Get aggregated metrics
     */
    getAggregated(serverId: string, period: AggregationPeriod, range?: TimeRange): AggregatedMetrics[];
    /**
     * Create aggregation for a time period
     */
    aggregate(serverId: string, period: AggregationPeriod, range: TimeRange): AggregatedMetrics | null;
    /**
     * Save a performance baseline
     */
    saveBaseline(baseline: PerformanceBaseline): void;
    /**
     * Get a baseline
     */
    getBaseline(id: string): PerformanceBaseline | undefined;
    /**
     * Get all baselines
     */
    getBaselines(): PerformanceBaseline[];
    /**
     * Delete a baseline
     */
    deleteBaseline(id: string): boolean;
    /**
     * Create baseline from current data
     */
    createBaseline(serverId: string, id: string, name: string, range: TimeRange, description?: string): PerformanceBaseline | null;
    /**
     * Get server IDs with stored metrics
     */
    getServerIds(): string[];
    /**
     * Get metrics count for a server
     */
    getMetricsCount(serverId: string): number;
    /**
     * Clear all metrics for a server
     */
    clearServer(serverId: string): void;
    /**
     * Clear all metrics
     */
    clear(): void;
    /**
     * Run cleanup based on retention policy
     */
    cleanup(): void;
    private checkAggregation;
}
/**
 * Create a new metrics storage
 */
export declare function createMetricsStorage(config?: Partial<MetricsStorageConfig>): MetricsStorage;
/**
 * Get metrics storage singleton
 */
export declare function getMetricsStorage(): MetricsStorage;
/**
 * Reset metrics storage singleton
 */
export declare function resetMetricsStorage(): void;
//# sourceMappingURL=metrics-storage.d.ts.map