/**
 * Performance Monitor
 * Implements MCP Design Guide Section 5.3 principles for performance measurement and observability
 */
export interface PerformanceMetrics {
    toolName: string;
    executionTime: number;
    success: boolean;
    errorType?: string;
    tokenCount?: number;
    cost?: number;
    timestamp: number;
    userId?: string;
    sessionId: string;
    parameters?: any;
}
export interface ToolQualityMetrics {
    toolName: string;
    totalCalls: number;
    successRate: number;
    averageExecutionTime: number;
    medianExecutionTime: number;
    p95ExecutionTime: number;
    errorTypes: Record<string, number>;
    totalTokens: number;
    totalCost: number;
    lastCalled: number;
}
export interface SystemMetrics {
    totalTools: number;
    totalCalls: number;
    overallSuccessRate: number;
    averageLatency: number;
    totalTokensUsed: number;
    totalCost: number;
    topPerformingTools: Array<{
        tool: string;
        successRate: number;
        calls: number;
    }>;
    slowestTools: Array<{
        tool: string;
        avgTime: number;
        calls: number;
    }>;
    mostErrorProneTools: Array<{
        tool: string;
        errorRate: number;
        calls: number;
    }>;
    errorBreakdown: Record<string, number>;
    timeRange: {
        start: number;
        end: number;
    };
}
export interface LLMJudgeEvaluation {
    toolName: string;
    outputQuality: number;
    appropriatenessScore: number;
    completenessScore: number;
    accuracyScore: number;
    comments: string;
    evaluationCriteria: string[];
    timestamp: number;
}
/**
 * Comprehensive performance monitoring and observability system
 */
export declare class PerformanceMonitor {
    private static instance;
    private metrics;
    private qualityEvaluations;
    private activeTraces;
    private constructor();
    static getInstance(): PerformanceMonitor;
    /**
     * Start tracking a tool execution
     */
    startTrace(traceId: string, toolName: string, context: {
        userId?: string;
        sessionId: string;
        parameters?: any;
    }): void;
    /**
     * End tracking and record metrics
     */
    endTrace(traceId: string, success: boolean, errorType?: string, additionalMetrics?: {
        tokenCount?: number;
        cost?: number;
    }): void;
    /**
     * Record LLM-as-a-Judge evaluation
     */
    recordQualityEvaluation(evaluation: Omit<LLMJudgeEvaluation, 'timestamp'>): void;
    /**
     * Generate comprehensive metrics for a specific tool
     */
    getToolMetrics(toolName: string, timeRange?: {
        start: number;
        end: number;
    }): ToolQualityMetrics | null;
    /**
     * Generate system-wide performance metrics
     */
    getSystemMetrics(timeRange?: {
        start: number;
        end: number;
    }): SystemMetrics;
    /**
     * Get quality evaluation metrics
     */
    getQualityMetrics(toolName?: string): {
        averageQuality: number;
        averageAppropriateness: number;
        averageCompleteness: number;
        averageAccuracy: number;
        totalEvaluations: number;
        evaluationTrend: Array<{
            timestamp: number;
            quality: number;
        }>;
    };
    /**
     * Generate performance alerts
     */
    generateAlerts(): Array<{
        type: string;
        message: string;
        severity: 'low' | 'medium' | 'high';
    }>;
    /**
     * Export metrics for external analysis
     */
    exportMetrics(format?: 'json' | 'csv'): string;
    /**
     * Record a tool execution directly (used by dashboard API)
     */
    recordToolExecution(toolName: string, success: boolean, duration?: number, metadata?: any): void;
    /**
     * Get module-specific metrics
     */
    getModuleMetrics(moduleName?: string): Record<string, any>;
    /**
     * Get all tool metrics as a summary
     */
    getAllToolMetrics(): Record<string, ToolQualityMetrics>;
    /**
     * Analyze performance bottlenecks
     */
    analyzeBottlenecks(options?: {
        threshold?: number;
    }): any;
    /**
     * Generate performance report
     */
    generatePerformanceReport(options?: {
        format?: string;
        includeRecommendations?: boolean;
    }): any;
    /**
     * Clear metrics data
     */
    clearMetrics(options?: {
        before?: string;
    }): any;
    private convertReportToCSV;
    private sanitizeParameters;
}
/**
 * Decorator for automatic performance monitoring
 */
export declare function monitorPerformance(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
/**
 * Create a unique trace ID for manual tracking
 */
export declare function createTraceId(toolName: string): string;
//# sourceMappingURL=performance-monitor.d.ts.map