export interface IServerStats {
    uptime: number;
    startTime: number;
    memoryUsage: {
        heapUsed: number;
        heapTotal: number;
        external: number;
        rss: number;
        maxMemoryMB?: number;
        actualUsageBytes?: number;
        actualUsagePercentage?: number;
    };
    cpuUsage: {
        user: number;
        system: number;
    };
    activeConnections: number;
    totalConnections: number;
    requestsPerSecond: number;
    throughput: {
        bytesIn: number;
        bytesOut: number;
        bytesInPerSecond: number;
        bytesOutPerSecond: number;
    };
}
export interface ITimeSeriesPoint {
    timestamp: number;
    value: number;
}
export interface IEmailStats {
    sent: number;
    received: number;
    bounced: number;
    queued: number;
    failed: number;
    averageDeliveryTime: number;
    deliveryRate: number;
    bounceRate: number;
    timeSeries?: {
        sent: ITimeSeriesPoint[];
        received: ITimeSeriesPoint[];
        failed: ITimeSeriesPoint[];
    };
}
export interface IDnsStats {
    totalQueries: number;
    cacheHits: number;
    cacheMisses: number;
    cacheHitRate: number;
    activeDomains: number;
    averageResponseTime: number;
    queryTypes: {
        [key: string]: number;
    };
    timeSeries?: {
        queries: ITimeSeriesPoint[];
    };
    recentQueries?: Array<{
        timestamp: number;
        domain: string;
        type: string;
        answered: boolean;
        responseTimeMs: number;
    }>;
}
export interface IRateLimitInfo {
    domain: string;
    currentRate: number;
    limit: number;
    remaining: number;
    resetTime: number;
    blocked: boolean;
}
export interface ISecurityEvent {
    timestamp: number;
    level: string;
    type: string;
    message: string;
    details?: any;
    ipAddress?: string;
    domain?: string;
    success?: boolean;
}
export interface ISecurityMetrics {
    blockedIPs: string[];
    reputationScores: {
        [domain: string]: number;
    };
    spamDetected: number;
    malwareDetected: number;
    phishingDetected: number;
    authenticationFailures: number;
    suspiciousActivities: number;
    recentEvents?: ISecurityEvent[];
}
export interface ILogEntry {
    timestamp: number;
    level: 'debug' | 'info' | 'warn' | 'error';
    category: 'smtp' | 'dns' | 'security' | 'system' | 'email';
    message: string;
    metadata?: any;
}
export interface IConnectionInfo {
    id: string;
    remoteAddress: string;
    localAddress: string;
    startTime: number;
    protocol: 'smtp' | 'smtps' | 'http' | 'https';
    state: 'connecting' | 'connected' | 'authenticated' | 'transmitting' | 'closing';
    bytesReceived: number;
    bytesSent: number;
    /** Present when the row is an aggregate, e.g. one row per remote IP. */
    connectionCount?: number;
}
export interface IQueueStatus {
    name: string;
    size: number;
    processing: number;
    failed: number;
    retrying: number;
    averageProcessingTime: number;
}
export interface IHealthStatus {
    healthy: boolean;
    uptime: number;
    services: {
        [service: string]: {
            status: 'healthy' | 'degraded' | 'unhealthy';
            message?: string;
            lastCheck: number;
        };
    };
    version?: string;
}
export interface IDomainActivity {
    domain: string;
    bytesInPerSecond: number;
    bytesOutPerSecond: number;
    activeConnections: number;
    routeCount: number;
    /** Lifetime request count when available from SmartProxy. */
    requestCount: number;
    /** Live HTTP request rate when SmartProxy exposes per-domain rates. */
    requestsPerSecond?: number;
    /** HTTP requests over the last minute when SmartProxy exposes per-domain rates. */
    requestsLastMinute?: number;
}
export interface IAsnActivity {
    asn: number;
    organization: string;
    country: string | null;
    activeConnections: number;
    ipCount: number;
    bytesInPerSecond: number;
    bytesOutPerSecond: number;
    sampleIps: string[];
}
export interface INetworkMetrics {
    totalBandwidth: {
        in: number;
        out: number;
    };
    totalBytes?: {
        in: number;
        out: number;
    };
    activeConnections: number;
    connectionDetails: IConnectionDetails[];
    topEndpoints: Array<{
        endpoint: string;
        connections: number;
        bandwidth: {
            in: number;
            out: number;
        };
    }>;
    topEndpointsByBandwidth: Array<{
        endpoint: string;
        connections: number;
        bandwidth: {
            in: number;
            out: number;
        };
    }>;
    topASNs: IAsnActivity[];
    domainActivity: IDomainActivity[];
    throughputHistory?: Array<{
        timestamp: number;
        in: number;
        out: number;
    }>;
    requestsPerSecond?: number;
    requestsTotal?: number;
    backends?: IBackendInfo[];
    frontendProtocols?: IProtocolDistribution | null;
    backendProtocols?: IProtocolDistribution | null;
}
export interface IProtocolDistribution {
    h1Active: number;
    h1Total: number;
    h2Active: number;
    h2Total: number;
    h3Active: number;
    h3Total: number;
    wsActive: number;
    wsTotal: number;
    otherActive: number;
    otherTotal: number;
}
export interface IConnectionDetails {
    remoteAddress: string;
    protocol: 'http' | 'https' | 'smtp' | 'smtps';
    state: 'connecting' | 'connected' | 'established' | 'closing';
    startTime: number;
    bytesIn: number;
    bytesOut: number;
    /** Present when the row is an aggregate, e.g. one row per remote IP. */
    connectionCount?: number;
}
export interface IBackendInfo {
    id?: string;
    backend: string;
    domain: string | null;
    protocol: string;
    activeConnections: number;
    totalConnections: number;
    connectErrors: number;
    handshakeErrors: number;
    requestErrors: number;
    avgConnectTimeMs: number;
    poolHitRate: number;
    h2Failures: number;
    h2Suppressed: boolean;
    h3Suppressed: boolean;
    h2CooldownRemainingSecs: number | null;
    h3CooldownRemainingSecs: number | null;
    h2ConsecutiveFailures: number | null;
    h3ConsecutiveFailures: number | null;
    h3Port: number | null;
    cacheAgeSecs: number | null;
}
export interface IRadiusStats {
    running: boolean;
    uptime: number;
    authRequests: number;
    authAccepts: number;
    authRejects: number;
    accountingRequests: number;
    activeSessions: number;
    totalInputBytes: number;
    totalOutputBytes: number;
}
export interface IVpnStats {
    running: boolean;
    subnet: string;
    registeredClients: number;
    connectedClients: number;
    wgListenPort: number;
}
