UNPKG

rcc-pipeline

Version:

RCC Pipeline Module - Pipeline system and workflow management based on pipeline-framework

161 lines 5.04 kB
/** * Pipeline Tracker - Request ID and Pipeline Tracking System * 流水线跟踪器 - 请求ID和流水线跟踪系统 */ import { PipelineBaseModule } from '../modules/PipelineBaseModule'; import { DebugCenter } from 'rcc-debugcenter'; import { IRequestContext } from '../interfaces/IRequestContext'; import { IPipelineStageFactory, IPipelineStageManager } from '../interfaces/IPipelineStage'; /** * Pipeline Tracker Main Class * 流水线跟踪器主类 */ export declare class PipelineTracker extends PipelineBaseModule { protected debugCenter: DebugCenter | null; /** * Set debug center for integration * 设置调试中心用于集成 */ setDebugCenter(debugCenter: DebugCenter): void; /** * Get debug center instance * 获取调试中心实例 */ getDebugCenter(): DebugCenter | null; /** * Event listener for tracking events * 跟踪事件的事件监听器 */ subscribe(event: string, callback: (data: any) => void): void; /** * Legacy on method for backward compatibility * @deprecated Use subscribe instead */ on(event: string, callback: (data: any) => void): void; private activeRequests; private stageFactory; private stageManager; constructor(); /** * Create new request context with I/O tracking * 创建新的请求上下文并启用I/O跟踪 */ createRequestContext(provider: string, operation: 'chat' | 'streamChat' | 'healthCheck', metadata?: Record<string, any>): IRequestContext; /** * Get request context by ID * 根据ID获取请求上下文 */ getRequestContext(requestId: string): IRequestContext | undefined; /** * Add pipeline stage with I/O tracking * 添加流水线阶段并记录I/O */ addStage(requestId: string, stageName: string): void; /** * Complete pipeline stage with I/O tracking * 完成流水线阶段并记录I/O */ completeStage(requestId: string, stageName: string, data?: any): void; /** * Mark stage as failed with I/O tracking * 标记阶段为失败并记录I/O */ failStage(requestId: string, stageName: string, error: string): void; /** * Complete request context with I/O tracking * 完成请求上下文并记录I/O */ completeRequest(requestId: string): IRequestContext | undefined; /** * Get all active requests * 获取所有活动请求 */ getActiveRequests(): IRequestContext[]; /** * Get request statistics * 获取请求统计 */ getRequestStatistics(): { activeRequests: number; totalStages: number; completedStages: number; failedStages: number; runningStages: number; }; /** * Clear all active requests * 清除所有活动请求 */ clearAllRequests(): void; /** * Generate unique request ID * 生成唯一请求ID */ private generateRequestId; /** * Generate unique pipeline ID * 生成唯一流水线ID */ private generatePipelineId; /** * Get stage factory * 获取阶段工厂 */ getStageFactory(): IPipelineStageFactory; /** * Get stage manager * 获取阶段管理器 */ getStageManager(): IPipelineStageManager; /** * Create context for pipeline execution (compatibility method) * 创建流水线执行上下文(兼容性方法) */ createContext(moduleInfo: any, stage: string, request?: any, options?: any): any; /** * Record request (compatibility method) * 记录请求(兼容性方法) */ recordRequest(context: any, request: any, stage: string): Promise<void>; /** * Record response (compatibility method) * 记录响应(兼容性方法) */ recordResponse(context: any, response: any, stage: string): Promise<void>; /** * Complete context (compatibility method) * 完成上下文(兼容性方法) */ completeContext(context: any, response?: any, error?: any): void; /** * Get execution statistics (compatibility method) * 获取执行统计(兼容性方法) */ getStatistics(): any; /** * Get active contexts (compatibility method) * 获取活动上下文(兼容性方法) */ getActiveContexts(): any[]; /** * Get active trace chains (compatibility method) * 获取活动跟踪链(兼容性方法) */ getActiveTraceChains(): any[]; /** * Sanitize data for logging (compatibility method) * 清理数据用于日志记录(兼容性方法) */ sanitizeData(data: any): any; /** * Get configuration (compatibility method) * 获取配置(兼容性方法) */ getConfig(): any; /** * Update configuration (compatibility method) * 更新配置(兼容性方法) */ updateConfig(newConfig: any): void; } //# sourceMappingURL=PipelineTracker.d.ts.map