import { ILogger } from './logger';
/**
 * Metric types
 */
export declare enum MetricType {
    COUNTER = "counter",
    GAUGE = "gauge",
    HISTOGRAM = "histogram",
    SUMMARY = "summary"
}
/**
 * Metric data point
 */
export interface MetricPoint {
    /** Metric name */
    name: string;
    /** Metric type */
    type: MetricType;
    /** Metric value */
    value: number;
    /** Timestamp when metric was recorded */
    timestamp: number;
    /** Optional labels/tags */
    labels?: Record<string, string>;
    /** Optional help text */
    help?: string;
}
/**
 * Metric aggregation result
 */
export interface MetricAggregation {
    /** Metric name */
    name: string;
    /** Number of data points */
    count: number;
    /** Sum of all values */
    sum: number;
    /** Average value */
    avg: number;
    /** Minimum value */
    min: number;
    /** Maximum value */
    max: number;
    /** Standard deviation */
    stdDev: number;
    /** Percentiles (50th, 90th, 95th, 99th) */
    percentiles: {
        p50: number;
        p90: number;
        p95: number;
        p99: number;
    };
}
/**
 * Metrics exporter interface
 */
export interface MetricsExporter {
    /** Exporter name */
    name: string;
    /** Export metrics */
    export(metrics: MetricPoint[]): Promise<void>;
}
/**
 * Console metrics exporter
 */
export declare class ConsoleMetricsExporter implements MetricsExporter {
    name: string;
    export(metrics: MetricPoint[]): Promise<void>;
    private groupMetricsByName;
    private calculateAggregation;
}
/**
 * JSON file metrics exporter
 */
export declare class FileMetricsExporter implements MetricsExporter {
    private filePath;
    name: string;
    constructor(filePath: string);
    export(metrics: MetricPoint[]): Promise<void>;
}
/**
 * Metrics collector configuration
 */
export interface MetricsConfig {
    /** Enable metrics collection */
    enabled?: boolean;
    /** Maximum number of metric points to keep in memory */
    maxPoints?: number;
    /** Export interval in milliseconds */
    exportInterval?: number;
    /** Metrics retention period in milliseconds */
    retentionPeriod?: number;
    /** Default labels to add to all metrics */
    defaultLabels?: Record<string, string>;
}
/**
 * Comprehensive metrics collector
 */
export declare class MetricsCollector {
    private logger;
    private config;
    private metrics;
    private exporters;
    private exportInterval?;
    private counters;
    private gauges;
    private histograms;
    constructor(logger: ILogger, config?: MetricsConfig);
    /**
     * Start the metrics collector
     */
    start(): void;
    /**
     * Stop the metrics collector
     */
    stop(): void;
    /**
     * Add metrics exporter
     */
    addExporter(exporter: MetricsExporter): void;
    /**
     * Remove metrics exporter
     */
    removeExporter(name: string): void;
    /**
     * Record a counter metric
     */
    counter(name: string, value?: number, labels?: Record<string, string>): void;
    /**
     * Record a gauge metric
     */
    gauge(name: string, value: number, labels?: Record<string, string>): void;
    /**
     * Record a histogram metric
     */
    histogram(name: string, value: number, labels?: Record<string, string>): void;
    /**
     * Record timing metric (convenience method for histogram)
     */
    timing(name: string, duration: number, labels?: Record<string, string>): void;
    /**
     * Create a timer function
     */
    timer(name: string, labels?: Record<string, string>): () => void;
    /**
     * Record custom metric
     */
    recordMetric(metric: Omit<MetricPoint, 'timestamp'> & {
        timestamp?: number;
    }): void;
    /**
     * Get all recorded metrics
     */
    getMetrics(): MetricPoint[];
    /**
     * Get metrics by name
     */
    getMetricsByName(name: string): MetricPoint[];
    /**
     * Get metric aggregation
     */
    getAggregation(name: string): MetricAggregation | null;
    /**
     * Export metrics using all configured exporters
     */
    exportMetrics(): Promise<void>;
    /**
     * Clean up old metrics
     */
    private cleanup;
    /**
     * Get current metrics summary
     */
    getSummary(): {
        totalMetrics: number;
        counters: number;
        gauges: number;
        histograms: number;
        oldestTimestamp?: number;
        newestTimestamp?: number;
    };
}
//# sourceMappingURL=metrics.d.ts.map