import type { IMetrics, IBackendMetrics, IThroughputData, IThroughputHistoryPoint } from './models/metrics-types.js';
import type { RustProxyBridge } from './rust-proxy-bridge.js';
/**
 * Adapts Rust JSON metrics to the IMetrics interface.
 *
 * Polls the Rust binary periodically via the bridge and caches the result.
 * All IMetrics getters read from the cache synchronously.
 *
 * Rust Metrics JSON fields (camelCase via serde):
 *   activeConnections, totalConnections, bytesIn, bytesOut,
 *   throughputInBytesPerSec, throughputOutBytesPerSec,
 *   routes: { [routeName]: { activeConnections, totalConnections, bytesIn, bytesOut, ... } }
 */
export declare class RustMetricsAdapter implements IMetrics {
    private bridge;
    private cache;
    private pollTimer;
    private pollIntervalMs;
    constructor(bridge: RustProxyBridge, pollIntervalMs?: number);
    /**
     * Poll Rust for metrics once. Can be awaited to ensure cache is fresh.
     */
    poll(): Promise<void>;
    startPolling(): void;
    stopPolling(): void;
    connections: {
        active: () => number;
        total: () => number;
        byRoute: () => Map<string, number>;
        byIP: () => Map<string, number>;
        topIPs: (limit?: number) => Array<{
            ip: string;
            count: number;
        }>;
    };
    throughput: {
        instant: () => IThroughputData;
        recent: () => IThroughputData;
        average: () => IThroughputData;
        custom: (_seconds: number) => IThroughputData;
        history: (seconds: number) => Array<IThroughputHistoryPoint>;
        byRoute: (_windowSeconds?: number) => Map<string, IThroughputData>;
        byIP: (_windowSeconds?: number) => Map<string, IThroughputData>;
    };
    requests: {
        perSecond: () => number;
        perMinute: () => number;
        total: () => number;
    };
    totals: {
        bytesIn: () => number;
        bytesOut: () => number;
        connections: () => number;
    };
    backends: {
        byBackend: () => Map<string, IBackendMetrics>;
        protocols: () => Map<string, string>;
        topByErrors: (limit?: number) => Array<{
            backend: string;
            errors: number;
        }>;
    };
    percentiles: {
        connectionDuration: () => {
            p50: number;
            p95: number;
            p99: number;
        };
        bytesTransferred: () => {
            in: {
                p50: number;
                p95: number;
                p99: number;
            };
            out: {
                p50: number;
                p95: number;
                p99: number;
            };
        };
    };
}
