@casoon/auditmysite
Version:
Professional website analysis suite with robust accessibility testing, Core Web Vitals performance monitoring, SEO analysis, and content optimization insights. Features isolated browser contexts, retry mechanisms, and comprehensive API endpoints for profe
93 lines • 2.45 kB
TypeScript
/**
* 🏥 Health Monitoring Utility
*
* Provides health monitoring and early warning system
* for the audit infrastructure.
*/
export interface HealthMetrics {
timestamp: number;
memoryUsage: NodeJS.MemoryUsage;
cpuUsage: NodeJS.CpuUsage;
uptime: number;
processId: number;
nodeVersion: string;
platform: string;
}
export interface HealthThresholds {
maxMemoryMB: number;
maxCpuPercent: number;
maxUptimeHours: number;
minFreeMemoryMB: number;
}
export interface HealthAlert {
level: 'info' | 'warning' | 'critical';
metric: string;
message: string;
value: number;
threshold: number;
timestamp: number;
}
export declare class HealthMonitor {
private thresholds;
private alerts;
private metrics;
private monitoring;
private interval?;
constructor(thresholds?: Partial<HealthThresholds>);
/**
* Start continuous health monitoring
*/
start(intervalMs?: number): void;
/**
* Stop health monitoring
*/
stop(): void;
/**
* Perform immediate health check
*/
checkHealth(): HealthMetrics;
/**
* Get current health status
*/
getHealthStatus(): {
status: 'healthy' | 'warning' | 'critical';
metrics: HealthMetrics;
alerts: HealthAlert[];
summary: string;
};
/**
* Get performance trends
*/
getTrends(): {
memoryTrend: 'stable' | 'increasing' | 'decreasing';
averageMemoryMB: number;
peakMemoryMB: number;
measurementCount: number;
};
/**
* Export health data for analysis
*/
exportHealthData(): {
thresholds: HealthThresholds;
alerts: HealthAlert[];
metrics: HealthMetrics[];
trends: {
memoryTrend: 'stable' | 'increasing' | 'decreasing';
averageMemoryMB: number;
peakMemoryMB: number;
measurementCount: number;
};
timestamp: number;
};
/**
* Clear all stored data
*/
clear(): void;
private collectMetrics;
private checkThresholds;
private addAlert;
}
export declare function getGlobalHealthMonitor(thresholds?: Partial<HealthThresholds>): HealthMonitor;
export declare function startGlobalHealthMonitoring(intervalMs?: number): HealthMonitor;
export declare function stopGlobalHealthMonitoring(): void;
//# sourceMappingURL=health-monitor.d.ts.map