/**
 * Health Check Service
 * Provides real-time system health monitoring without intervention
 * Data is informational only - no automatic service stops based on metrics
 */
import { Router } from "express";
export interface SystemHealth {
    status: "healthy" | "degraded" | "unhealthy";
    timestamp: string;
    uptime: number;
    environment: string;
    version: string;
    pid: number;
    platform: string;
    nodeVersion: string;
}
export interface SystemMetrics {
    cpu: {
        usage: number;
        count: number;
        model: string;
        speed: number;
        loadAverage: number[];
    };
    memory: {
        total: number;
        used: number;
        free: number;
        percentage: number;
    };
    disk: {
        total: number;
        used: number;
        free: number;
        percentage: number;
        path: string;
    };
    network: {
        interfaces: NetworkInterface[];
    };
    process: {
        pid: number;
        memory: NodeJS.MemoryUsage;
        cpuUsage: NodeJS.CpuUsage;
        uptime: number;
    };
}
export interface NetworkInterface {
    name: string;
    address: string;
    family: string;
    internal: boolean;
}
export interface HealthCheckOptions {
    includeCpu?: boolean;
    includeMemory?: boolean;
    includeDisk?: boolean;
    includeNetwork?: boolean;
    includeProcess?: boolean;
    diskPath?: string;
    customChecks?: CustomHealthCheck[];
}
export interface CustomHealthCheck {
    name: string;
    check: () => Promise<HealthCheckResult>;
}
export interface HealthCheckResult {
    name: string;
    status: "healthy" | "degraded" | "unhealthy";
    message?: string;
    data?: any;
}
export interface DependencyHealth {
    name: string;
    status: "connected" | "disconnected" | "error";
    responseTime?: number;
    error?: string;
}
declare class HealthCheckService {
    private static instance;
    private cpuUsageHistory;
    private memoryUsageHistory;
    private lastCpuInfo;
    private metricsInterval?;
    private historySize;
    private constructor();
    static getInstance(): HealthCheckService;
    /**
     * Get basic system health status
     */
    getHealth(appVersion?: string): Promise<SystemHealth>;
    /**
     * Get detailed system metrics
     */
    getMetrics(options?: HealthCheckOptions): Promise<SystemMetrics>;
    /**
     * Get CPU metrics with real usage calculation
     */
    private getCpuMetrics;
    /**
     * Calculate real CPU usage percentage
     */
    private calculateCpuUsage;
    /**
     * Get memory metrics
     */
    private getMemoryMetrics;
    /**
     * Get disk metrics for specified path
     */
    private getDiskMetrics;
    /**
     * Get network interface information
     */
    private getNetworkMetrics;
    /**
     * Get current process metrics
     */
    private getProcessMetrics;
    /**
     * Check dependency health (database, Redis, external APIs, etc.)
     */
    checkDependencies(dependencies: {
        name: string;
        check: () => Promise<boolean>;
    }[]): Promise<DependencyHealth[]>;
    /**
     * Run custom health checks
     */
    runCustomChecks(checks: CustomHealthCheck[]): Promise<HealthCheckResult[]>;
    /**
     * Get metrics history for graphs
     */
    getMetricsHistory(): {
        cpu: number[];
        memory: number[];
    };
    /**
     * Start collecting metrics periodically for history
     */
    private startMetricsCollection;
    /**
     * Stop metrics collection (for cleanup)
     */
    stopMetricsCollection(): void;
}
/**
 * Create health check router for Express apps
 */
export declare function createHealthCheckRouter(options?: {
    version?: string;
    customChecks?: CustomHealthCheck[];
    dependencies?: Array<{
        name: string;
        check: () => Promise<boolean>;
    }>;
}): Router;
export declare function getHealthCheckService(): HealthCheckService;
export type { HealthCheckService };
//# sourceMappingURL=healthCheck.d.ts.map