bevy_perf_hud
A configurable performance heads-up display (HUD) plugin for Bevy applications. Visualize frame pacing, entity counts, and resource usage in real time, with extensibility for your own metrics.
Features
- Flexible HUD layout with multi-curve graphs and resource bars.
- Built-in providers for FPS, frame time, entity count, and system/process CPU & memory usage.
- Fine-grained control over smoothing, quantization, autoscaling, and appearance.
- Extensible
PerfMetricProvidertrait for custom metrics that appear alongside built-ins.
Installation
Add the crate to your Cargo.toml:
[]
= { = "0.16", = false, = ["bevy_winit", "bevy_ui", "bevy_render"] }
= "0.1"
Tip: If you rely on
DefaultPlugins, ensurebevy_diagnosticandbevy_uifeatures are enabled so the HUD can gather data and render correctly.
Quick Start
use *;
use BevyPerfHudPlugin;
By default the HUD appears near the top-right corner. To reposition or customize the layout, insert a PerfHudSettings
resource before adding the plugin:
use *;
use ;
Built-in Metrics
| Metric ID | Description |
|---|---|
fps |
Frames per second (floored to an integer). |
frame_time_ms |
Smoothed frame time in milliseconds. |
entity_count |
Active entity count in the World. |
system/cpu_usage |
Overall system CPU usage percentage. |
system/mem_usage |
Overall system memory usage percentage. |
process/cpu_usage |
CPU usage of the running process. |
process/mem_usage |
Memory footprint of the running process (MiB). |
Custom Metrics
Implement the PerfMetricProvider trait and register it with the PerfHudAppExt helper:
use *;
use ;
;
Examples
The repository ships with two runnable examples:
examples/simple.rs: 3D scene with keyboard shortcuts (Space spawns cubes, F1 toggles HUD modes).examples/custom_metric.rs: Demonstrates registering an additional metric provider.
Run them with:
Supported Versions
| bevy | bevy_perf_hud |
|---|---|
| 0.16 | 0.1 |
License
Dual-licensed under either the MIT License or Apache License 2.0.
Acknowledgements
- Bevy Engine for providing the ECS/game-engine foundation.
bevy_diagnosticandSystemInformationDiagnosticsPluginfor the metrics that power the HUD.
Looking for the Chinese documentation? See README_CN.md.