adpa-enterprise-framework-automation
Version:
Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe
59 lines • 1.68 kB
TypeScript
/**
* Performance Monitoring Utilities
* Provides timing and metrics for CLI commands
*/
interface PerformanceMetrics {
commandName: string;
startTime: number;
endTime?: number;
duration?: number;
memoryUsage?: NodeJS.MemoryUsage;
success: boolean;
errorMessage?: string;
}
declare class PerformanceMonitor {
private metrics;
/**
* Start timing a command
*/
startCommand(commandName: string): string;
/**
* End timing a command
*/
endCommand(id: string, success?: boolean, errorMessage?: string): PerformanceMetrics | null;
/**
* Get metrics for a command
*/
getMetrics(id: string): PerformanceMetrics | null;
/**
* Get all metrics
*/
getAllMetrics(): PerformanceMetrics[];
/**
* Generate performance report
*/
generateReport(): string;
/**
* Format duration in human-readable format
*/
private formatDuration;
/**
* Format memory in human-readable format
*/
private formatMemory;
/**
* Clear all metrics
*/
clear(): void;
}
export declare const performanceMonitor: PerformanceMonitor;
/**
* Decorator for measuring command performance
*/
export declare function measurePerformance(commandName: string): <T extends (...args: any[]) => Promise<any>>(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
/**
* Simple function wrapper for performance measurement
*/
export declare function withPerformanceTracking<T>(commandName: string, fn: () => Promise<T>): Promise<T>;
export type { PerformanceMetrics };
//# sourceMappingURL=performance.d.ts.map