MCPcopy Create free account
hub / github.com/esengine/esengine / logStats

Method logStats

packages/core/src/Plugins/DebugPlugin.ts:325–349  ·  view source on GitHub ↗

* 打印统计信息到日志

()

Source from the content-addressed store, hash-verified

323 * 打印统计信息到日志
324 */
325 private logStats(): void {
326 const stats = this.getStats();
327
328 logger.info('=== ECS Debug Stats ===');
329 logger.info(`Total Entities: ${stats.totalEntities}`);
330 logger.info(`Total Systems: ${stats.totalSystems}`);
331 logger.info(`Scenes: ${stats.scenes.length}`);
332
333 for (const scene of stats.scenes) {
334 logger.info(`\n[Scene: ${scene.name}]`);
335 logger.info(` Entities: ${scene.entityCount}`);
336 logger.info(` Systems: ${scene.systems.length}`);
337
338 for (const system of scene.systems) {
339 const perfStr = system.performance
340 ? ` | Avg: ${system.performance.avgExecutionTime.toFixed(2)}ms, Max: ${system.performance.maxExecutionTime.toFixed(2)}ms`
341 : '';
342 logger.info(
343 ` - ${system.name} (${system.enabled ? 'enabled' : 'disabled'}) | Entities: ${system.entityCount}${perfStr}`
344 );
345 }
346 }
347
348 logger.info('========================\n');
349 }
350
351 /**
352 * 导出调试数据为 JSON

Callers 1

startMethod · 0.95

Calls 2

getStatsMethod · 0.95
infoMethod · 0.45

Tested by

no test coverage detected