web-perf-mcp
Version:
MCP Server that audits the web page for finding the bottlenecks and CPU profiling using Lighthouse and Puppeteer
36 lines (35 loc) • 1.58 kB
TypeScript
import type { CPUProfile, CPUProfileAnalysis, PerformanceMetrics } from './types';
import { SourceMapResolver } from './resolver.js';
declare class CPUProfileAnalyzer {
sourceMapResolver: SourceMapResolver;
private nodeById;
private analysisResults;
analyzeCPUProfile(cpuProfilePath: string, traceEventsPath: string): Promise<CPUProfileAnalysis>;
loadAuditReport(reportPath: string): Promise<PerformanceMetrics>;
analyzeAuditReport(reportPath: string): Promise<PerformanceMetrics>;
analyzeCPUProfileData(cpuProfile: CPUProfile): Promise<void>;
private resolveSourceMapsForTopFunctions;
processSamplesSpeedscope(samples: number[], timeDeltas: number[], startTime: number): {
collapsedSamples: number[];
sampleTimes: number[];
};
calculateTotalTimesSpeedscope(nodeById: Map<number, any>): void;
shouldIgnoreFunction(callFrame: any): boolean;
getDisplayName(callFrame: any): string;
calculateTotalTimes(nodeMap: Map<number, any>, nodes: any[]): void;
getSeverity(percentage: number): string;
getFileNameFromUrl(url: string): string;
generateFlamegraphData(): Promise<any>;
private generateCallStackAnalysis;
private identifyHotPaths;
private buildFunctionHierarchy;
private createVisualSummary;
private findDeepestCallStacks;
private findMostFrequentCallPaths;
private buildCallPath;
private findChildFunctions;
private isLeafFunction;
private analyzeExecutionPattern;
generate(flamegraphData?: any): CPUProfileAnalysis;
}
export default CPUProfileAnalyzer;