aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
100 lines • 2.37 kB
TypeScript
/**
* @file performance-monitor.ts
* @description Real-time performance monitoring and alerting
*
* Implements F-011/UC-011: Performance Monitoring
* - Real-time performance tracking
* - Alerting on threshold violations
* - Performance profiling
* - Bottleneck detection
* - Resource monitoring (CPU, memory, disk)
*
* @implements NFR-PERF-001: <1% performance overhead
* @implements NFR-PERF-002: Alert latency <5s
* @implements NFR-PERF-003: 99.9% uptime
*/
import { EventEmitter } from 'events';
export interface PerformanceThreshold {
metric: string;
warning: number;
critical: number;
unit: string;
}
export interface PerformanceAlert {
timestamp: Date;
metric: string;
value: number;
threshold: number;
severity: 'warning' | 'critical';
message: string;
}
export interface PerformanceSample {
timestamp: Date;
cpu: number;
memory: number;
responseTime: number;
throughput: number;
errorRate: number;
}
export interface PerformanceMonitorConfig {
sampleInterval?: number;
alertCallback?: (alert: PerformanceAlert) => void;
thresholds?: PerformanceThreshold[];
}
export declare class PerformanceMonitor extends EventEmitter {
private config;
private samples;
private monitoring;
private monitoringTimer?;
constructor(config?: PerformanceMonitorConfig);
/**
* Start monitoring
*/
start(): void;
/**
* Stop monitoring
*/
stop(): void;
/**
* Collect performance sample
*/
private collectSample;
/**
* Get CPU usage (not implemented - returns 0)
*/
private getCPUUsage;
/**
* Get memory usage
*/
private getMemoryUsage;
/**
* Check thresholds and emit alerts
*/
private checkThresholds;
/**
* Get sample value for metric
*/
private getSampleValue;
/**
* Emit performance alert
*/
private emitAlert;
/**
* Get default thresholds
*/
private getDefaultThresholds;
/**
* Get recent samples
*/
getSamples(count?: number): PerformanceSample[];
/**
* Get performance statistics
*/
getStatistics(): {
avgCPU: number;
avgMemory: number;
avgResponseTime: number;
samples: number;
};
}
//# sourceMappingURL=performance-monitor.d.ts.map