MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / calculatePerformanceMetrics

Function calculatePerformanceMetrics

src/ChartGPU.ts:1044–1077  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1042 };
1043
1044 const calculatePerformanceMetrics = (): PerformanceMetrics => {
1045 const fps = calculateExactFPS();
1046 const frameTimeStats = calculateFrameTimeStats();
1047
1048 const gpuTiming: GPUTimingStats = {
1049 enabled: false, // GPU timing not yet implemented for main thread
1050 cpuTime: lastCPUTime as Milliseconds,
1051 gpuTime: 0 as Milliseconds,
1052 };
1053
1054 const memory: MemoryStats = {
1055 used: 0 as Bytes,
1056 peak: 0 as Bytes,
1057 allocated: 0 as Bytes,
1058 };
1059
1060 const frameDrops: FrameDropStats = {
1061 totalDrops: totalDroppedFrames,
1062 consecutiveDrops: consecutiveDroppedFrames,
1063 lastDropTimestamp: lastDropTimestamp as Milliseconds,
1064 };
1065
1066 const elapsedTime = performance.now() - startTime;
1067
1068 return {
1069 fps,
1070 frameTimeStats,
1071 gpuTiming,
1072 memory,
1073 frameDrops,
1074 totalFrames,
1075 elapsedTime: elapsedTime as Milliseconds,
1076 };
1077 };
1078
1079 const buildPayload = (match: HitTestMatch | null, event: PointerEvent): ChartGPUEventPayload => {
1080 if (!match) {

Callers 2

requestRenderFunction · 0.85
getPerformanceMetricsFunction · 0.85

Calls 2

calculateExactFPSFunction · 0.85
calculateFrameTimeStatsFunction · 0.85

Tested by

no test coverage detected