r3f-frame-profiler 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -61
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +7 -12890
- package/dist/esm/index.js.map +1 -1
- package/dist/index-D_LaF0YP.cjs +2 -0
- package/dist/index-D_LaF0YP.cjs.map +1 -0
- package/dist/index-o5zvhDta.js +4406 -0
- package/dist/index-o5zvhDta.js.map +1 -0
- package/dist/report-generator-BCq_enQo.js +283 -0
- package/dist/report-generator-BCq_enQo.js.map +1 -0
- package/dist/report-generator-BsoP53qp.cjs +61 -0
- package/dist/report-generator-BsoP53qp.cjs.map +1 -0
- package/dist/types/FrameProfiler.d.ts +2 -0
- package/dist/types/FrameProfiler.d.ts.map +1 -0
- package/dist/types/collectors/frame-time-collector.d.ts +41 -0
- package/dist/types/collectors/frame-time-collector.d.ts.map +1 -0
- package/dist/types/collectors/gpu-collector.d.ts +32 -0
- package/dist/types/collectors/gpu-collector.d.ts.map +1 -0
- package/dist/types/collectors/hot-path-detector.d.ts +42 -0
- package/dist/types/collectors/hot-path-detector.d.ts.map +1 -0
- package/dist/types/collectors/index.d.ts +7 -0
- package/dist/types/collectors/index.d.ts.map +1 -0
- package/dist/types/collectors/memory-collector.d.ts +49 -0
- package/dist/types/collectors/memory-collector.d.ts.map +1 -0
- package/dist/types/collectors/scene-collector.d.ts +47 -0
- package/dist/types/collectors/scene-collector.d.ts.map +1 -0
- package/dist/types/components/ReactProfiler.d.ts +12 -0
- package/dist/types/components/ReactProfiler.d.ts.map +1 -0
- package/dist/types/core/alert-system.d.ts +37 -0
- package/dist/types/core/alert-system.d.ts.map +1 -0
- package/dist/types/core/auto-instrumentation.d.ts +33 -0
- package/dist/types/core/auto-instrumentation.d.ts.map +1 -0
- package/dist/types/core/budget-manager.d.ts +78 -0
- package/dist/types/core/budget-manager.d.ts.map +1 -0
- package/dist/types/core/data-export.d.ts +24 -0
- package/dist/types/core/data-export.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +4 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/monitor-state.d.ts +21 -0
- package/dist/types/core/monitor-state.d.ts.map +1 -0
- package/dist/types/core/profiler.d.ts +83 -0
- package/dist/types/core/profiler.d.ts.map +1 -0
- package/dist/types/core/react-monitor.d.ts +51 -0
- package/dist/types/core/react-monitor.d.ts.map +1 -0
- package/dist/types/core/report-generator.d.ts +83 -0
- package/dist/types/core/report-generator.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +17 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useAlerts.d.ts +11 -0
- package/dist/types/hooks/useAlerts.d.ts.map +1 -0
- package/dist/types/hooks/useBudgetChecker.d.ts +6 -0
- package/dist/types/hooks/useBudgetChecker.d.ts.map +1 -0
- package/dist/types/hooks/useFrameHistory.d.ts +2 -0
- package/dist/types/hooks/useFrameHistory.d.ts.map +1 -0
- package/dist/types/hooks/useFrameTime.d.ts +3 -0
- package/dist/types/hooks/useFrameTime.d.ts.map +1 -0
- package/dist/types/hooks/useGPUStats.d.ts +3 -0
- package/dist/types/hooks/useGPUStats.d.ts.map +1 -0
- package/dist/types/hooks/useHotPath.d.ts +3 -0
- package/dist/types/hooks/useHotPath.d.ts.map +1 -0
- package/dist/types/hooks/useMemoryHistory.d.ts +5 -0
- package/dist/types/hooks/useMemoryHistory.d.ts.map +1 -0
- package/dist/types/hooks/useMemoryStats.d.ts +3 -0
- package/dist/types/hooks/useMemoryStats.d.ts.map +1 -0
- package/dist/types/hooks/useMetricsCollector.d.ts +31 -0
- package/dist/types/hooks/useMetricsCollector.d.ts.map +1 -0
- package/dist/types/hooks/usePerformanceBudget.d.ts +20 -0
- package/dist/types/hooks/usePerformanceBudget.d.ts.map +1 -0
- package/dist/types/hooks/useProfiler.d.ts +5 -0
- package/dist/types/hooks/useProfiler.d.ts.map +1 -0
- package/dist/types/hooks/useR3FProfiler.d.ts +2 -0
- package/dist/types/hooks/useR3FProfiler.d.ts.map +1 -0
- package/dist/types/hooks/useR3FProfilerCollector.d.ts +2 -0
- package/dist/types/hooks/useR3FProfilerCollector.d.ts.map +1 -0
- package/dist/types/hooks/useR3FStatsCollector.d.ts +2 -0
- package/dist/types/hooks/useR3FStatsCollector.d.ts.map +1 -0
- package/dist/types/hooks/useReactProfiler.d.ts +3 -0
- package/dist/types/hooks/useReactProfiler.d.ts.map +1 -0
- package/dist/types/hooks/useReportMetric.d.ts +19 -0
- package/dist/types/hooks/useReportMetric.d.ts.map +1 -0
- package/dist/types/hooks/useSceneStats.d.ts +3 -0
- package/dist/types/hooks/useSceneStats.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/ui/PerformanceMonitor.d.ts +7 -0
- package/dist/types/ui/PerformanceMonitor.d.ts.map +1 -0
- package/dist/types/ui/components/AlertBadge.d.ts +9 -0
- package/dist/types/ui/components/AlertBadge.d.ts.map +1 -0
- package/dist/types/ui/components/MetricCard.d.ts +14 -0
- package/dist/types/ui/components/MetricCard.d.ts.map +1 -0
- package/dist/types/ui/components/SimpleChart.d.ts +13 -0
- package/dist/types/ui/components/SimpleChart.d.ts.map +1 -0
- package/dist/types/ui/components/Tabs.d.ts +15 -0
- package/dist/types/ui/components/Tabs.d.ts.map +1 -0
- package/dist/types/ui/components/index.d.ts +5 -0
- package/dist/types/ui/components/index.d.ts.map +1 -0
- package/dist/types/ui/panels/BudgetPanel.d.ts +2 -0
- package/dist/types/ui/panels/BudgetPanel.d.ts.map +1 -0
- package/dist/types/ui/panels/FramePanel.d.ts +2 -0
- package/dist/types/ui/panels/FramePanel.d.ts.map +1 -0
- package/dist/types/ui/panels/FrameTimePanel.d.ts +2 -0
- package/dist/types/ui/panels/FrameTimePanel.d.ts.map +1 -0
- package/dist/types/ui/panels/GPUPanel.d.ts +2 -0
- package/dist/types/ui/panels/GPUPanel.d.ts.map +1 -0
- package/dist/types/ui/panels/HotPathPanel.d.ts +2 -0
- package/dist/types/ui/panels/HotPathPanel.d.ts.map +1 -0
- package/dist/types/ui/panels/MemoryPanel.d.ts +2 -0
- package/dist/types/ui/panels/MemoryPanel.d.ts.map +1 -0
- package/dist/types/ui/panels/ReactPanel.d.ts +2 -0
- package/dist/types/ui/panels/ReactPanel.d.ts.map +1 -0
- package/dist/types/ui/panels/ScenePanel.d.ts +2 -0
- package/dist/types/ui/panels/ScenePanel.d.ts.map +1 -0
- package/dist/types/ui/panels/index.d.ts +9 -0
- package/dist/types/ui/panels/index.d.ts.map +1 -0
- package/dist/types/ui/styles/theme.d.ts +76 -0
- package/dist/types/ui/styles/theme.d.ts.map +1 -0
- package/dist/types/ui/visualizations/FrameGraph.d.ts +10 -0
- package/dist/types/ui/visualizations/FrameGraph.d.ts.map +1 -0
- package/dist/types/ui/visualizations/MemoryChart.d.ts +10 -0
- package/dist/types/ui/visualizations/MemoryChart.d.ts.map +1 -0
- package/dist/types/ui/visualizations/PerformanceChart.d.ts +16 -0
- package/dist/types/ui/visualizations/PerformanceChart.d.ts.map +1 -0
- package/dist/types/ui/visualizations/TimelineView.d.ts +7 -0
- package/dist/types/ui/visualizations/TimelineView.d.ts.map +1 -0
- package/dist/types/ui/visualizations/index.d.ts +5 -0
- package/dist/types/ui/visualizations/index.d.ts.map +1 -0
- package/package.json +12 -7
- package/README.md +0 -60
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { WebGLRenderer } from 'three';
|
|
2
|
+
interface PerformanceMemory {
|
|
3
|
+
usedJSHeapSize: number;
|
|
4
|
+
totalJSHeapSize: number;
|
|
5
|
+
jsHeapSizeLimit: number;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface Performance {
|
|
9
|
+
memory?: PerformanceMemory;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export interface MemoryStats {
|
|
13
|
+
jsHeap: {
|
|
14
|
+
used: number;
|
|
15
|
+
total: number;
|
|
16
|
+
limit: number;
|
|
17
|
+
percentage: number;
|
|
18
|
+
};
|
|
19
|
+
gpuMemory: {
|
|
20
|
+
textures: number;
|
|
21
|
+
geometries: number;
|
|
22
|
+
total: number;
|
|
23
|
+
};
|
|
24
|
+
leaks: {
|
|
25
|
+
detected: boolean;
|
|
26
|
+
growthRate: number;
|
|
27
|
+
trend: 'stable' | 'increasing' | 'decreasing';
|
|
28
|
+
};
|
|
29
|
+
timestamp: number;
|
|
30
|
+
}
|
|
31
|
+
declare class MemoryCollector {
|
|
32
|
+
private renderer;
|
|
33
|
+
private lastStats;
|
|
34
|
+
private history;
|
|
35
|
+
private readonly historySize;
|
|
36
|
+
private startTime;
|
|
37
|
+
private readonly warmupPeriod;
|
|
38
|
+
setRenderer(renderer: WebGLRenderer): void;
|
|
39
|
+
getStats(): MemoryStats | null;
|
|
40
|
+
private getJSHeapStats;
|
|
41
|
+
private getGPUMemoryStats;
|
|
42
|
+
private addToHistory;
|
|
43
|
+
private detectLeaks;
|
|
44
|
+
getLastStats(): MemoryStats | null;
|
|
45
|
+
reset(): void;
|
|
46
|
+
}
|
|
47
|
+
export declare const memoryCollector: MemoryCollector;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=memory-collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-collector.d.ts","sourceRoot":"","sources":["../../../src/collectors/memory-collector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,UAAU,iBAAiB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,MAAM,CAAC,EAAE,iBAAiB,CAAC;KAC5B;CACF;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC;KAC/C,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,cAAM,eAAe;IACnB,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,OAAO,CAAkD;IACjE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAM;IAClC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAO1C,QAAQ,IAAI,WAAW,GAAG,IAAI;IA6B9B,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,iBAAiB;IA6CzB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,WAAW;IAiEnB,YAAY,IAAI,WAAW,GAAG,IAAI;IAIlC,KAAK,IAAI,IAAI;CAKd;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Scene } from 'three';
|
|
2
|
+
export interface SceneStats {
|
|
3
|
+
objects: {
|
|
4
|
+
total: number;
|
|
5
|
+
meshes: number;
|
|
6
|
+
lights: number;
|
|
7
|
+
cameras: number;
|
|
8
|
+
groups: number;
|
|
9
|
+
other: number;
|
|
10
|
+
};
|
|
11
|
+
materials: {
|
|
12
|
+
total: number;
|
|
13
|
+
byType: Record<string, number>;
|
|
14
|
+
};
|
|
15
|
+
textures: {
|
|
16
|
+
total: number;
|
|
17
|
+
totalSize: number;
|
|
18
|
+
byFormat: Record<string, number>;
|
|
19
|
+
environment: number;
|
|
20
|
+
system: number;
|
|
21
|
+
};
|
|
22
|
+
geometries: {
|
|
23
|
+
total: number;
|
|
24
|
+
vertices: number;
|
|
25
|
+
faces: number;
|
|
26
|
+
};
|
|
27
|
+
visible: {
|
|
28
|
+
meshes: number;
|
|
29
|
+
total: number;
|
|
30
|
+
};
|
|
31
|
+
complexity: {
|
|
32
|
+
averageVerticesPerMesh: number;
|
|
33
|
+
averageFacesPerMesh: number;
|
|
34
|
+
totalDrawCalls: number;
|
|
35
|
+
};
|
|
36
|
+
timestamp: number;
|
|
37
|
+
}
|
|
38
|
+
declare class SceneCollector {
|
|
39
|
+
private scene;
|
|
40
|
+
setScene(scene: Scene): void;
|
|
41
|
+
getStats(): SceneStats | null;
|
|
42
|
+
private estimateTextureSize;
|
|
43
|
+
reset(): void;
|
|
44
|
+
}
|
|
45
|
+
export declare const sceneCollector: SceneCollector;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=scene-collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-collector.d.ts","sourceRoot":"","sources":["../../../src/collectors/scene-collector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAsB,MAAM,OAAO,CAAC;AAGvD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC;IACF,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE;QACV,sBAAsB,EAAE,MAAM,CAAC;QAC/B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,cAAM,cAAc;IAClB,OAAO,CAAC,KAAK,CAAsB;IAEnC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI5B,QAAQ,IAAI,UAAU,GAAG,IAAI;IAmT7B,OAAO,CAAC,mBAAmB;IA2B3B,KAAK,IAAI,IAAI;CAGd;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ProfilerProps, type ReactNode } from 'react';
|
|
2
|
+
export interface ReactProfilerProps {
|
|
3
|
+
id: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onRender?: ProfilerProps['onRender'];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Wrapper component that profiles React component renders
|
|
9
|
+
* Usage: <ReactProfiler id="MyComponent"><MyComponent /></ReactProfiler>
|
|
10
|
+
*/
|
|
11
|
+
export declare const ReactProfiler: ({ id, children, onRender }: ReactProfilerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ReactProfiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactProfiler.d.ts","sourceRoot":"","sources":["../../../src/components/ReactProfiler.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,4BAA4B,kBAAkB,4CA8B3E,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BudgetViolation } from './budget-manager';
|
|
2
|
+
export interface Alert {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'budget' | 'memory-leak' | 'performance' | 'custom';
|
|
5
|
+
severity: 'info' | 'warning' | 'error';
|
|
6
|
+
title: string;
|
|
7
|
+
message: string;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
dismissed?: boolean;
|
|
10
|
+
data?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
declare class AlertSystem {
|
|
13
|
+
private alerts;
|
|
14
|
+
private readonly maxAlerts;
|
|
15
|
+
private listeners;
|
|
16
|
+
private soundEnabled;
|
|
17
|
+
createFromViolation(violation: BudgetViolation): Alert;
|
|
18
|
+
createAlert(type: Alert['type'], severity: Alert['severity'], title: string, message: string, data?: Record<string, unknown>): Alert;
|
|
19
|
+
private addAlert;
|
|
20
|
+
getAlerts(includeDismissed?: boolean): Alert[];
|
|
21
|
+
getActiveAlerts(): Alert[];
|
|
22
|
+
getAlertsBySeverity(severity: Alert['severity']): Alert[];
|
|
23
|
+
getAlertsByType(type: Alert['type']): Alert[];
|
|
24
|
+
dismissAlert(id: string): void;
|
|
25
|
+
dismissAll(): void;
|
|
26
|
+
removeAlert(id: string): void;
|
|
27
|
+
clearAlerts(): void;
|
|
28
|
+
setSoundEnabled(enabled: boolean): void;
|
|
29
|
+
isSoundEnabled(): boolean;
|
|
30
|
+
private playAlertSound;
|
|
31
|
+
subscribe(listener: (alerts: Alert[]) => void): () => void;
|
|
32
|
+
private notifyListeners;
|
|
33
|
+
reset(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare const alertSystem: AlertSystem;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=alert-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-system.d.ts","sourceRoot":"","sources":["../../../src/core/alert-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,aAAa,GAAG,aAAa,GAAG,QAAQ,CAAC;IAC1D,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,cAAM,WAAW;IACf,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAM;IAChC,OAAO,CAAC,SAAS,CAA6C;IAC9D,OAAO,CAAC,YAAY,CAAkB;IAGtC,mBAAmB,CAAC,SAAS,EAAE,eAAe,GAAG,KAAK;IAgBtD,WAAW,CACT,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EACnB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,KAAK;IAgBR,OAAO,CAAC,QAAQ;IAwBhB,SAAS,CAAC,gBAAgB,GAAE,OAAe,GAAG,KAAK,EAAE;IAOrD,eAAe,IAAI,KAAK,EAAE;IAI1B,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,KAAK,EAAE;IAIzD,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,EAAE;IAI7C,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAQ9B,UAAU,IAAI,IAAI;IAOlB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAK7B,WAAW,IAAI,IAAI;IAKnB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIvC,cAAc,IAAI,OAAO;IAIzB,OAAO,CAAC,cAAc;IAyBtB,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI;IAO1D,OAAO,CAAC,eAAe;IAWvB,KAAK,IAAI,IAAI;CAKd;AAED,eAAO,MAAM,WAAW,aAAoB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automatic frame breakdown instrumentation
|
|
3
|
+
* This system automatically detects and measures different phases of a frame
|
|
4
|
+
*/
|
|
5
|
+
declare class AutoInstrumentation {
|
|
6
|
+
private enabled;
|
|
7
|
+
private reactPhaseStart;
|
|
8
|
+
private isReactRendering;
|
|
9
|
+
private isUpdating;
|
|
10
|
+
private isPhysicsRunning;
|
|
11
|
+
private isRendering;
|
|
12
|
+
private mutationObserver;
|
|
13
|
+
enable(): void;
|
|
14
|
+
disable(): void;
|
|
15
|
+
private setupReactInstrumentation;
|
|
16
|
+
private setupThreeJSInstrumentation;
|
|
17
|
+
private setupPhysicsInstrumentation;
|
|
18
|
+
startFrame(): void;
|
|
19
|
+
startReactPhase(): void;
|
|
20
|
+
endReactPhase(): void;
|
|
21
|
+
onReactRender(actualDuration: number): void;
|
|
22
|
+
startUpdatePhase(): void;
|
|
23
|
+
endUpdatePhase(): void;
|
|
24
|
+
startPhysicsPhase(): void;
|
|
25
|
+
endPhysicsPhase(): void;
|
|
26
|
+
startRenderPhase(): void;
|
|
27
|
+
endRenderPhase(): void;
|
|
28
|
+
private cleanup;
|
|
29
|
+
isActive(): boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const autoInstrumentation: AutoInstrumentation;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=auto-instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-instrumentation.d.ts","sourceRoot":"","sources":["../../../src/core/auto-instrumentation.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,cAAM,mBAAmB;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,gBAAgB,CAAiC;IAEzD,MAAM,IAAI,IAAI;IAQd,OAAO,IAAI,IAAI;IAMf,OAAO,CAAC,yBAAyB;IAuCjC,OAAO,CAAC,2BAA2B;IAKnC,OAAO,CAAC,2BAA2B;IAQnC,UAAU,IAAI,IAAI;IAKlB,eAAe,IAAI,IAAI;IAOvB,aAAa,IAAI,IAAI;IAOrB,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAgB3C,gBAAgB,IAAI,IAAI;IAMxB,cAAc,IAAI,IAAI;IAMtB,iBAAiB,IAAI,IAAI;IAMzB,eAAe,IAAI,IAAI;IAMvB,gBAAgB,IAAI,IAAI;IAMxB,cAAc,IAAI,IAAI;IAOtB,OAAO,CAAC,OAAO;IAYf,QAAQ,IAAI,OAAO;CAGpB;AAED,eAAO,MAAM,mBAAmB,qBAA4B,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface PerformanceBudget {
|
|
2
|
+
fps?: {
|
|
3
|
+
min: number;
|
|
4
|
+
};
|
|
5
|
+
frameTime?: {
|
|
6
|
+
max: number;
|
|
7
|
+
};
|
|
8
|
+
memory?: {
|
|
9
|
+
max: number;
|
|
10
|
+
jsHeap?: {
|
|
11
|
+
maxPercentage: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
gpu?: {
|
|
15
|
+
drawCalls?: {
|
|
16
|
+
max: number;
|
|
17
|
+
};
|
|
18
|
+
triangles?: {
|
|
19
|
+
max: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface BudgetViolation {
|
|
24
|
+
id: string;
|
|
25
|
+
metric: string;
|
|
26
|
+
current: number;
|
|
27
|
+
budget: number;
|
|
28
|
+
severity: 'warning' | 'error';
|
|
29
|
+
timestamp: number;
|
|
30
|
+
message: string;
|
|
31
|
+
}
|
|
32
|
+
export type BudgetViolationHistory = BudgetViolation[];
|
|
33
|
+
declare class BudgetManager {
|
|
34
|
+
private budget;
|
|
35
|
+
private violations;
|
|
36
|
+
private readonly maxHistorySize;
|
|
37
|
+
private listeners;
|
|
38
|
+
private readonly STORAGE_KEY;
|
|
39
|
+
constructor();
|
|
40
|
+
private loadBudget;
|
|
41
|
+
private saveBudget;
|
|
42
|
+
private isValidBudget;
|
|
43
|
+
setBudget(budget: PerformanceBudget): void;
|
|
44
|
+
getBudget(): PerformanceBudget | null;
|
|
45
|
+
checkBudget(metrics: {
|
|
46
|
+
fps?: number;
|
|
47
|
+
frameTime?: number;
|
|
48
|
+
memory?: {
|
|
49
|
+
used: number;
|
|
50
|
+
jsHeapPercentage?: number;
|
|
51
|
+
};
|
|
52
|
+
gpu?: {
|
|
53
|
+
drawCalls: number;
|
|
54
|
+
triangles: number;
|
|
55
|
+
};
|
|
56
|
+
}): BudgetViolation[];
|
|
57
|
+
getViolations(): BudgetViolationHistory;
|
|
58
|
+
getRecentViolations(seconds?: number): BudgetViolation[];
|
|
59
|
+
getViolationsByMetric(metric: string): BudgetViolation[];
|
|
60
|
+
clearViolations(): void;
|
|
61
|
+
getRecommendedBudget(metrics: {
|
|
62
|
+
fps?: number;
|
|
63
|
+
frameTime?: number;
|
|
64
|
+
memory?: {
|
|
65
|
+
used: number;
|
|
66
|
+
};
|
|
67
|
+
gpu?: {
|
|
68
|
+
drawCalls: number;
|
|
69
|
+
triangles: number;
|
|
70
|
+
};
|
|
71
|
+
}): PerformanceBudget;
|
|
72
|
+
subscribe(listener: (violations: BudgetViolation[]) => void): () => void;
|
|
73
|
+
private notifyListeners;
|
|
74
|
+
reset(): void;
|
|
75
|
+
}
|
|
76
|
+
export declare const budgetManager: BudgetManager;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=budget-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budget-manager.d.ts","sourceRoot":"","sources":["../../../src/core/budget-manager.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,SAAS,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,CAAC,EAAE;YACP,aAAa,EAAE,MAAM,CAAC;SACvB,CAAC;KACH,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,SAAS,CAAC,EAAE;YACV,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,SAAS,CAAC,EAAE;YACV,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,M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I,EAAE,MAAM,CAAA;SAAE,CAAC;QAC1B,GAAG,CAAC,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;KAChD,GAAG,iBAAiB;IA8CrB,SAAS,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI;IAOxE,OAAO,CAAC,eAAe;IAWvB,KAAK,IAAI,IAAI;CAOd;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GPUStats } from '../collectors/gpu-collector';
|
|
2
|
+
import type { SceneStats } from '../collectors/scene-collector';
|
|
3
|
+
import type { MemoryStats } from '../collectors/memory-collector';
|
|
4
|
+
import type { FrameBreakdown } from '../collectors/frame-time-collector';
|
|
5
|
+
import type { ReactPerformanceData } from './react-monitor';
|
|
6
|
+
export interface ExportData {
|
|
7
|
+
timestamp: number;
|
|
8
|
+
frameHistory: number[];
|
|
9
|
+
gpuStats?: GPUStats;
|
|
10
|
+
sceneStats?: SceneStats;
|
|
11
|
+
memoryStats?: MemoryStats;
|
|
12
|
+
frameBreakdown?: FrameBreakdown;
|
|
13
|
+
reactData?: ReactPerformanceData;
|
|
14
|
+
}
|
|
15
|
+
declare class DataExporter {
|
|
16
|
+
exportJSON(data: ExportData): string;
|
|
17
|
+
exportCSV(data: ExportData): string;
|
|
18
|
+
downloadJSON(data: ExportData, filename?: string): void;
|
|
19
|
+
downloadCSV(data: ExportData, filename?: string): void;
|
|
20
|
+
private downloadFile;
|
|
21
|
+
}
|
|
22
|
+
export declare const dataExporter: DataExporter;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=data-export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-export.d.ts","sourceRoot":"","sources":["../../../src/core/data-export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC;AAED,cAAM,YAAY;IAChB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAIpC,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAsBnC,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,GAAE,MAAgC,GAAG,IAAI;IAKhF,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,GAAE,MAA+B,GAAG,IAAI;IAK9E,OAAO,CAAC,YAAY;CAWrB;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global state manager for Performance Monitor
|
|
3
|
+
* Handles pause/resume functionality
|
|
4
|
+
*/
|
|
5
|
+
declare class MonitorState {
|
|
6
|
+
private isPaused;
|
|
7
|
+
private listeners;
|
|
8
|
+
private readonly STORAGE_KEY;
|
|
9
|
+
constructor();
|
|
10
|
+
private loadPauseState;
|
|
11
|
+
private savePauseState;
|
|
12
|
+
pause(): void;
|
|
13
|
+
resume(): void;
|
|
14
|
+
toggle(): void;
|
|
15
|
+
getPaused(): boolean;
|
|
16
|
+
subscribe(listener: (paused: boolean) => void): () => void;
|
|
17
|
+
private notifyListeners;
|
|
18
|
+
}
|
|
19
|
+
export declare const monitorState: MonitorState;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=monitor-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor-state.d.ts","sourceRoot":"","sources":["../../../src/core/monitor-state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAM,YAAY;IAChB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAA6C;IAC9D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyB;;IAOrD,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,cAAc;IAQtB,KAAK,IAAI,IAAI;IAOb,MAAM,IAAI,IAAI;IAOd,MAAM,IAAI,IAAI;IAQd,SAAS,IAAI,OAAO;IAIpB,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAO1D,OAAO,CAAC,eAAe;CASxB;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export interface ProfilerEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
total: number;
|
|
4
|
+
avg: number;
|
|
5
|
+
max: number;
|
|
6
|
+
calls: number;
|
|
7
|
+
percentage: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ProfilerData {
|
|
10
|
+
entries: ProfilerEntry[];
|
|
11
|
+
totalTime: number;
|
|
12
|
+
calls: number;
|
|
13
|
+
frames: number;
|
|
14
|
+
}
|
|
15
|
+
declare class Profiler {
|
|
16
|
+
private data;
|
|
17
|
+
private frameCount;
|
|
18
|
+
private enabled;
|
|
19
|
+
private maxHistorySize;
|
|
20
|
+
private listeners;
|
|
21
|
+
private reportGenerator;
|
|
22
|
+
constructor();
|
|
23
|
+
private updateEnabledState;
|
|
24
|
+
isEnabled(): boolean;
|
|
25
|
+
profile<T>(name: string, fn: () => T): T;
|
|
26
|
+
profileAsync<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
27
|
+
record(name: string, duration: number): void;
|
|
28
|
+
wrap<T extends (...args: any[]) => any>(name: string, fn: T): T;
|
|
29
|
+
wrapAsync<T extends (...args: any[]) => Promise<any>>(name: string, fn: T): T;
|
|
30
|
+
getData(): ProfilerData | null;
|
|
31
|
+
/**
|
|
32
|
+
* Get raw profiler data including individual timing samples for percentile analysis
|
|
33
|
+
*/
|
|
34
|
+
getRawData(): Map<string, {
|
|
35
|
+
total: number;
|
|
36
|
+
calls: number;
|
|
37
|
+
max: number;
|
|
38
|
+
times: number[];
|
|
39
|
+
}> | null;
|
|
40
|
+
reset(): void;
|
|
41
|
+
subscribe(listener: (data: ProfilerData | null) => void): () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Notifie tous les listeners
|
|
44
|
+
*/
|
|
45
|
+
private notifyListeners;
|
|
46
|
+
/**
|
|
47
|
+
* Force une notification aux listeners
|
|
48
|
+
*/
|
|
49
|
+
notify(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Configure la taille maximale de l'historique
|
|
52
|
+
*/
|
|
53
|
+
setMaxHistorySize(size: number): void;
|
|
54
|
+
/**
|
|
55
|
+
* Génère un rapport de performance markdown
|
|
56
|
+
* Optimisé pour être analysé par une IA
|
|
57
|
+
*/
|
|
58
|
+
generateReport(): Promise<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Copie le rapport dans le clipboard
|
|
61
|
+
*/
|
|
62
|
+
copyReportToClipboard(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Enregistre une frame pour les statistiques du rapport
|
|
65
|
+
*/
|
|
66
|
+
recordFrameStats(fps: number, frameTime: number, memoryMB?: number): void;
|
|
67
|
+
/**
|
|
68
|
+
* Enregistre une métrique custom pour le rapport
|
|
69
|
+
*/
|
|
70
|
+
recordMetricForReport(name: string, value: number): void;
|
|
71
|
+
}
|
|
72
|
+
export declare const profiler: Profiler;
|
|
73
|
+
export declare const profile: <T>(name: string, fn: () => T) => T;
|
|
74
|
+
export declare const profileAsync: <T>(name: string, fn: () => Promise<T>) => Promise<T>;
|
|
75
|
+
export declare const record: (name: string, duration: number) => void;
|
|
76
|
+
export declare const wrap: <T extends (...args: any[]) => any>(name: string, fn: T) => T;
|
|
77
|
+
export declare const wrapAsync: <T extends (...args: any[]) => Promise<any>>(name: string, fn: T) => T;
|
|
78
|
+
export declare const getProfilerData: () => ProfilerData | null;
|
|
79
|
+
export declare const resetProfiler: () => void;
|
|
80
|
+
export declare const isProfilerEnabled: () => boolean;
|
|
81
|
+
export declare const reportMetric: (name: string, value: number) => void;
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=profiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../../src/core/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AASD,cAAM,QAAQ;I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EF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,IAE1D,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ProfilerOnRenderCallback } from 'react';
|
|
2
|
+
export interface ReactComponentRender {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
phase: 'mount' | 'update';
|
|
6
|
+
actualDuration: number;
|
|
7
|
+
baseDuration: number;
|
|
8
|
+
startTime: number;
|
|
9
|
+
commitTime: number;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ReactComponentStats {
|
|
13
|
+
name: string;
|
|
14
|
+
renderCount: number;
|
|
15
|
+
totalDuration: number;
|
|
16
|
+
averageDuration: number;
|
|
17
|
+
maxDuration: number;
|
|
18
|
+
minDuration: number;
|
|
19
|
+
lastRenderTime: number;
|
|
20
|
+
phases: {
|
|
21
|
+
mount: number;
|
|
22
|
+
update: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface ReactPerformanceData {
|
|
26
|
+
components: Map<string, ReactComponentStats>;
|
|
27
|
+
recentRenders: ReactComponentRender[];
|
|
28
|
+
totalRenders: number;
|
|
29
|
+
slowComponents: ReactComponentStats[];
|
|
30
|
+
frequentRenders: ReactComponentStats[];
|
|
31
|
+
timestamp: number;
|
|
32
|
+
}
|
|
33
|
+
declare class ReactMonitor {
|
|
34
|
+
private componentStats;
|
|
35
|
+
private recentRenders;
|
|
36
|
+
private totalRenders;
|
|
37
|
+
private readonly maxRecentRenders;
|
|
38
|
+
private readonly slowThreshold;
|
|
39
|
+
private readonly frequentThreshold;
|
|
40
|
+
onRenderCallback: ProfilerOnRenderCallback;
|
|
41
|
+
private getComponentName;
|
|
42
|
+
private updateComponentStats;
|
|
43
|
+
getPerformanceData(): ReactPerformanceData;
|
|
44
|
+
getComponentStats(componentName: string): ReactComponentStats | null;
|
|
45
|
+
getSlowComponents(): ReactComponentStats[];
|
|
46
|
+
getFrequentRenders(): ReactComponentStats[];
|
|
47
|
+
reset(): void;
|
|
48
|
+
}
|
|
49
|
+
export declare const reactMonitor: ReactMonitor;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=react-monitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-monitor.d.ts","sourceRoot":"","sources":["../../../src/core/react-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGtD,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC7C,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,mBAAmB,EAAE,CAAC;IACtC,eAAe,EAAE,mBAAmB,EAAE,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,cAAM,YAAY;IAChB,OAAO,CAAC,cAAc,CAA+C;IACrE,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAO;IACxC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAM;IACpC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAM;IAGxC,gBAAgB,EAAE,wBAAwB,CAoCxC;IAEF,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,oBAAoB;IAkC5B,kBAAkB,IAAI,oBAAoB;IA8B1C,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI;IAIpE,iBAAiB,IAAI,mBAAmB,EAAE;IAK1C,kBAAkB,IAAI,mBAAmB,EAAE;IAK3C,KAAK,IAAI,IAAI;CAKd;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export interface PerformanceIssue {
|
|
2
|
+
severity: 'critical' | 'warning' | 'info';
|
|
3
|
+
metric: string;
|
|
4
|
+
value: number;
|
|
5
|
+
threshold: number;
|
|
6
|
+
suggestion: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PerformanceReport {
|
|
9
|
+
timestamp: string;
|
|
10
|
+
duration: number;
|
|
11
|
+
summary: {
|
|
12
|
+
avgFps: number;
|
|
13
|
+
minFps: number;
|
|
14
|
+
maxFps: number;
|
|
15
|
+
avgFrameTime: number;
|
|
16
|
+
totalFrames: number;
|
|
17
|
+
};
|
|
18
|
+
memory: {
|
|
19
|
+
current: number;
|
|
20
|
+
peak: number;
|
|
21
|
+
trend: 'increasing' | 'stable' | 'decreasing';
|
|
22
|
+
};
|
|
23
|
+
issues: PerformanceIssue[];
|
|
24
|
+
hotspots: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
avgTime: number;
|
|
27
|
+
maxTime: number;
|
|
28
|
+
callCount: number;
|
|
29
|
+
p95: number;
|
|
30
|
+
p99: number;
|
|
31
|
+
variance: number;
|
|
32
|
+
percentOfFrame: number;
|
|
33
|
+
}>;
|
|
34
|
+
customMetrics: Record<string, {
|
|
35
|
+
min: number;
|
|
36
|
+
max: number;
|
|
37
|
+
avg: number;
|
|
38
|
+
current: number;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Génère un rapport de performance formaté en markdown
|
|
43
|
+
* Optimisé pour être donné à une IA pour analyse
|
|
44
|
+
*/
|
|
45
|
+
export declare class ReportGenerator {
|
|
46
|
+
private startTime;
|
|
47
|
+
private frameCount;
|
|
48
|
+
private fpsSamples;
|
|
49
|
+
private frameTimeSamples;
|
|
50
|
+
private memorySamples;
|
|
51
|
+
private customMetricHistory;
|
|
52
|
+
/**
|
|
53
|
+
* Enregistre une frame pour les statistiques
|
|
54
|
+
*/
|
|
55
|
+
recordFrame(fps: number, frameTime: number, memoryMB?: number): void;
|
|
56
|
+
/**
|
|
57
|
+
* Enregistre une métrique custom
|
|
58
|
+
*/
|
|
59
|
+
recordMetric(name: string, value: number): void;
|
|
60
|
+
/**
|
|
61
|
+
* Génère le rapport complet
|
|
62
|
+
*/
|
|
63
|
+
generateReport(): PerformanceReport;
|
|
64
|
+
/**
|
|
65
|
+
* Génère un rapport markdown lisible
|
|
66
|
+
*/
|
|
67
|
+
generateMarkdownReport(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Copie le rapport dans le clipboard
|
|
70
|
+
*/
|
|
71
|
+
copyReportToClipboard(): Promise<void>;
|
|
72
|
+
private average;
|
|
73
|
+
private calculateTrend;
|
|
74
|
+
private detectIssues;
|
|
75
|
+
private extractHotspots;
|
|
76
|
+
private analyzeCustomMetrics;
|
|
77
|
+
/**
|
|
78
|
+
* Reset toutes les statistiques
|
|
79
|
+
*/
|
|
80
|
+
reset(): void;
|
|
81
|
+
}
|
|
82
|
+
export declare const reportGenerator: ReportGenerator;
|
|
83
|
+
//# sourceMappingURL=report-generator.d.ts.map
|
|
@@ -0,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AGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,mBAAmB,CAAoC;IAE/D;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAmB7D;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAaxC;;OAEG;IACH,cAAc,IAAI,iBAAiB;IAoDnC;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAuHhC;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAc5C,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,YAAY;IA0EpB,OAAO,CAAC,eAAe;IAyEvB,OAAO,CAAC,oBAAoB;IAiB5B;;OAEG;IACH,KAAK;CAQN;AAGD,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './useProfiler';
|
|
2
|
+
export * from './useR3FProfiler';
|
|
3
|
+
export { ProfilerDataCollector } from './useR3FProfilerCollector';
|
|
4
|
+
export { R3FStatsCollector } from './useR3FStatsCollector';
|
|
5
|
+
export { useFrameHistory } from './useFrameHistory';
|
|
6
|
+
export { useGPUStats } from './useGPUStats';
|
|
7
|
+
export { useSceneStats } from './useSceneStats';
|
|
8
|
+
export { useMemoryStats } from './useMemoryStats';
|
|
9
|
+
export { useFrameTime } from './useFrameTime';
|
|
10
|
+
export { usePerformanceBudget } from './usePerformanceBudget';
|
|
11
|
+
export { useAlerts } from './useAlerts';
|
|
12
|
+
export { useBudgetChecker } from './useBudgetChecker';
|
|
13
|
+
export { useReactProfiler } from './useReactProfiler';
|
|
14
|
+
export { useHotPath } from './useHotPath';
|
|
15
|
+
export { useMetricsCollector } from './useMetricsCollector';
|
|
16
|
+
export { useMemoryHistory } from './useMemoryHistory';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Alert } from '../core/alert-system';
|
|
2
|
+
export declare function useAlerts(): {
|
|
3
|
+
alerts: Alert[];
|
|
4
|
+
dismissAlert: (id: string) => void;
|
|
5
|
+
dismissAll: () => void;
|
|
6
|
+
removeAlert: (id: string) => void;
|
|
7
|
+
clearAlerts: () => void;
|
|
8
|
+
setSoundEnabled: (enabled: boolean) => void;
|
|
9
|
+
isSoundEnabled: () => boolean;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useAlerts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAlerts.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAlerts.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE/D,wBAAgB,SAAS;;uBAiBG,MAAM;;sBAQP,MAAM;;+BAQG,OAAO;;EAiB1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBudgetChecker.d.ts","sourceRoot":"","sources":["../../../src/hooks/useBudgetChecker.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,gBAAgB,SAyE/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFrameHistory.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFrameHistory.ts"],"names":[],"mappings":"AAOA,wBAAgB,eAAe,aAoF9B"}
|