bevy-debugging-profiling
Installation
SKILL.md
Bevy debugging and profiling
When to use
Load this when a running app should print logs or record frame time, entity count, or process CPU and memory. bevy::log::LogPlugin and bevy::diagnostic on docs.rs latest (0.20.0) are the sources.
ECS shape
- Logs:
LogPluginis part ofDefaultPlugins. Override it withDefaultPlugins.set(LogPlugin { level, filter, .. }). The page's example usesLevel::DEBUGand a filter string such aswgpu=error,bevy_render=info,bevy_ecs=trace. The same filter works asRUST_LOG. To bring your own collector, disable this plugin onDefaultPlugins. - Diagnostics core:
DiagnosticsPluginadds the core resources.DiagnosticsStoreholds the collection.Diagnosticis a timeline ofDiagnosticMeasurementvalues addressed byDiagnosticPath.RegisterDiagnosticaddsregister_diagnosticonApp. - Built-in plugins:
FrameTimeDiagnosticsPluginadds frame time, fps, and frame count.EntityCountDiagnosticsPluginadds an entity count.SystemInformationDiagnosticsPluginaddscpu_usageandmem_usagepercent.LogDiagnosticsPluginprints diagnostics to the console.FrameCount/FrameCountPlugincount frames since start. - Order: the log-diagnostics example adds these plugins after
DefaultPluginsbecause they use the time plugin for timestamps. - Schedule: you do not write the measurement systems yourself unless you register your own
Diagnostic. Check the diagnostics docs for aDiagnosticsStoreread before writing one.