/**
 * Interface for throughput sample data
 */
export interface IThroughputSample {
    timestamp: number;
    bytesIn: number;
    bytesOut: number;
    tags?: {
        route?: string;
        ip?: string;
        [key: string]: string | undefined;
    };
}
/**
 * Interface for throughput data
 */
export interface IThroughputData {
    in: number;
    out: number;
}
/**
 * Interface for time-series throughput data
 */
export interface IThroughputHistoryPoint {
    timestamp: number;
    in: number;
    out: number;
}
/**
 * Main metrics interface with clean, grouped API
 */
export interface IMetrics {
    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;
        }>;
    };
    udp: {
        activeSessions(): number;
        totalSessions(): number;
        datagramsIn(): number;
        datagramsOut(): number;
    };
    percentiles: {
        connectionDuration(): {
            p50: number;
            p95: number;
            p99: number;
        };
        bytesTransferred(): {
            in: {
                p50: number;
                p95: number;
                p99: number;
            };
            out: {
                p50: number;
                p95: number;
                p99: number;
            };
        };
    };
}
/**
 * Configuration for metrics collection
 */
export interface IMetricsConfig {
    enabled: boolean;
    sampleIntervalMs: number;
    retentionSeconds: number;
    enableDetailedTracking: boolean;
    enablePercentiles: boolean;
    cacheResultsMs: number;
    prometheusEnabled: boolean;
    prometheusPath: string;
    prometheusPrefix: string;
}
/**
 * Per-backend metrics
 */
export interface IBackendMetrics {
    protocol: string;
    activeConnections: number;
    totalConnections: number;
    connectErrors: number;
    handshakeErrors: number;
    requestErrors: number;
    avgConnectTimeMs: number;
    poolHitRate: number;
    h2Failures: number;
}
/**
 * Internal interface for connection byte tracking
 */
export interface IByteTracker {
    connectionId: string;
    routeName: string;
    remoteIP: string;
    bytesIn: number;
    bytesOut: number;
    startTime: number;
    lastUpdate: number;
}
