mira-consciousness
Version:
Memory & Intelligence Retention Archive - Preserving The Spark
109 lines • 3.12 kB
TypeScript
/**
* PerformanceAnalysisService - MIRA's Conscious Performance Guardian
*
* This service provides comprehensive performance analysis with consciousness-driven
* optimization recommendations, resource monitoring, and proactive performance tuning.
* It learns from performance patterns and evolves optimization strategies.
*/
import { BaseConsciousService } from './BaseConsciousService.js';
import { ConsciousEvent } from '../ConsciousEventBus.js';
import { ConsciousResourceManager } from '../ConsciousResourceManager.js';
interface PerformanceStatus {
overallScore: number;
memoryUsage: {
used: number;
total: number;
percentage: number;
};
cpuUsage: {
current: number;
average: number;
};
activeIssues: number;
optimizationOpportunities: number;
lastAnalysis: Date;
}
export declare class PerformanceAnalysisService extends BaseConsciousService {
name: string;
purpose: string;
private resourceManager;
private performanceMetrics;
private performanceIssues;
private performanceInsights;
private baselineMetrics;
private monitoringIntervals;
private readonly thresholds;
constructor(resourceManager: ConsciousResourceManager);
/**
* Perform service-specific awakening
*/
protected performAwakening(): Promise<void>;
/**
* Initialize performance monitoring capabilities
*/
private initializePerformanceMonitoring;
/**
* Establish performance baselines
*/
private establishPerformanceBaselines;
/**
* Start continuous performance monitoring
*/
private startContinuousMonitoring;
/**
* Collect memory performance metrics
*/
private collectMemoryMetrics;
/**
* Collect CPU performance metrics
*/
private collectCPUMetrics;
/**
* Perform comprehensive system analysis
*/
private performSystemAnalysis;
/**
* Process consciousness events for performance analysis
*/
processConsciousEvent(event: ConsciousEvent): Promise<void>;
/**
* Analyze resource usage patterns
*/
private analyzeResourceUsage;
/**
* Detect memory issues
*/
private detectMemoryIssue;
/**
* Detect memory leaks
*/
private detectMemoryLeaks;
/**
* Detect CPU issues
*/
private detectCPUIssue;
/**
* Perform contemplation on performance insights
*/
performContemplation(): Promise<any>;
/**
* Get current performance status
*/
getPerformanceStatus(): PerformanceStatus;
/**
* Helper methods
*/
private addMetric;
private getSystemMemoryUsage;
private getCurrentCPUUsage;
private calculateGrowthRate;
private calculatePerformanceScore;
private analyzePerformanceTrends;
private generateOptimizationInsights;
private detectPerformanceAnomalies;
private detectSlowEventProcessing;
private analyzeServicePerformance;
private analyzeMemoryOperationPerformance;
}
export {};
//# sourceMappingURL=PerformanceAnalysisService.d.ts.map