UNPKG

traceperf

Version:

High-performance function execution tracking and monitoring for Node.js

53 lines (52 loc) 1.27 kB
/** * Execution data for a function call */ export interface ExecutionData { name: string; duration: number; isSlow: boolean; memoryUsage?: number; level: number; } /** * ASCII art generator for execution flow charts */ export declare class AsciiArtGenerator { private _boxWidth; /** * Create a new AsciiArtGenerator instance * * @param options - Generator options */ constructor(options?: { boxWidth?: number; }); /** * Generate a flow chart for a sequence of function executions * * @param executions - Array of execution data * @returns ASCII art flow chart */ generateFlowChart(executions: ExecutionData[]): string; /** * Generate a box for a function execution * * @param execution - The execution data * @returns ASCII art box */ private generateFunctionBox; /** * Generate an arrow between function boxes * * @param levelDiff - Difference in nesting level * @returns ASCII art arrow */ private generateArrow; /** * Format memory usage in a human-readable format * * @param bytes - Memory usage in bytes * @returns Formatted memory usage */ private formatMemory; }