@japofc/baileys - v2.4.7
    Preparing search index...

    Interface HealthMonitor

    interface HealthMonitor {
        isRunning: boolean;
        addProbe(name: string, fn: () => unknown): () => void;
        getHistory(): HealthSnapshot[];
        getThresholds(): Record<string, number>;
        isAlerting(metric: string): boolean;
        onAlert(cb: (alert: HealthAlert) => void): () => void;
        onRecover(cb: (alert: HealthAlert) => void): () => void;
        onSnapshot(cb: (snapshot: HealthSnapshot) => void): () => void;
        setThreshold(metric: string, value: number | null): void;
        snapshot(): Promise<HealthSnapshot>;
        start(): () => void;
        stop(): void;
    }
    Index
    isRunning: boolean
    • Register a custom metric. Returns a remover.

      Parameters

      • name: string
      • fn: () => unknown

      Returns () => void

    • Add/change a threshold live (null removes it).

      Parameters

      • metric: string
      • value: number | null

      Returns void