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: LogPlugin is part of DefaultPlugins. Override it with DefaultPlugins.set(LogPlugin { level, filter, .. }). The page's example uses Level::DEBUG and a filter string such as wgpu=error,bevy_render=info,bevy_ecs=trace. The same filter works as RUST_LOG. To bring your own collector, disable this plugin on DefaultPlugins.
  • Diagnostics core: DiagnosticsPlugin adds the core resources. DiagnosticsStore holds the collection. Diagnostic is a timeline of DiagnosticMeasurement values addressed by DiagnosticPath. RegisterDiagnostic adds register_diagnostic on App.
  • Built-in plugins: FrameTimeDiagnosticsPlugin adds frame time, fps, and frame count. EntityCountDiagnosticsPlugin adds an entity count. SystemInformationDiagnosticsPlugin adds cpu_usage and mem_usage percent. LogDiagnosticsPlugin prints diagnostics to the console. FrameCount / FrameCountPlugin count frames since start.
  • Order: the log-diagnostics example adds these plugins after DefaultPlugins because 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 a DiagnosticsStore read before writing one.

Coming from Godot

Installs
4
GitHub Stars
850
First Seen
3 days ago