Crate bevy_perf_hud

Crate bevy_perf_hud 

Source
Expand description

Bevy Performance HUD Plugin

A comprehensive performance monitoring overlay for Bevy applications that displays:

  • Real-time performance graphs with configurable metrics
  • System resource usage bars (CPU, memory)
  • Custom metric tracking with extensible provider system
  • Configurable visual appearance and positioning

Structs§

BarConfig
Configuration for a single performance bar.
BarMaterial
Material definition for rendering performance bars in the HUD.
BarParams
Parameters for the bar chart shader.
BarScaleState
State for tracking dynamic bar scaling
BarScaleStates
Resource storing dynamic scaling states for all performance bars.
BarsSettings
Configuration for the performance bars display.
BevyPerfHudPlugin
Main plugin for the Bevy Performance HUD.
CurveConfig
Configuration for a single curve (line) in a performance graph.
CurveDefaults
Default values for curve configuration options.
EntityCountMetricProvider
Built-in metric provider for the total number of entities.
FpsMetricProvider
Built-in metric provider for frames per second (FPS).
FrameTimeMetricProvider
Built-in metric provider for frame time in milliseconds.
GraphBorder
Configuration for graph border appearance.
GraphLabelHandle
Handle to a graph label entity, linking it to its metric.
GraphScaleState
Resource storing the current smoothed Y-axis scale for graphs.
GraphSettings
Configuration for the performance graph (chart) display.
HistoryBuffers
Resource storing historical values for graph curve rendering.
HudHandles
Resource containing handles to all HUD-related entities and materials.
MetricDefinition
Definition of a performance metric for display purposes.
MetricProviders
Resource managing the registry of all metric providers.
MetricSampleContext
Context passed to metric providers during sampling.
MultiLineGraphMaterial
Material definition for rendering multi-line graphs in the performance HUD.
MultiLineGraphParams
Parameters for the multi-line graph shader.
PerfHudSettings
Main configuration resource for the performance HUD.
ProcessCpuUsageMetricProvider
Built-in metric provider for process-specific CPU usage percentage.
ProcessMemUsageMetricProvider
Built-in metric provider for process-specific memory usage in bytes.
SampledValues
Resource storing the most recent sampled values for all performance metrics.
SystemCpuUsageMetricProvider
Built-in metric provider for system-wide CPU usage percentage.
SystemMemUsageMetricProvider
Built-in metric provider for system-wide memory usage percentage.

Enums§

BarScaleMode
Bar scaling mode determines how the bar range is calculated.

Constants§

MAX_CURVES
Maximum number of curves that can be displayed simultaneously in a graph
MAX_SAMPLES
Maximum number of samples to store in the history buffer for graph rendering
PROCESS_CPU_USAGE_ID
Metric ID for process-specific CPU usage percentage
PROCESS_MEM_USAGE_ID
Metric ID for process-specific memory usage in bytes
SAMPLES_VEC4
Number of Vec4 elements needed to pack all samples for shader
SYSTEM_CPU_USAGE_ID
Metric ID for system-wide CPU usage percentage
SYSTEM_MEM_USAGE_ID
Metric ID for system-wide memory usage percentage

Traits§

PerfHudAppExt
Extension trait for App to easily register custom metric providers.
PerfMetricProvider
Trait for implementing custom performance metric providers.

Functions§

sample_diagnostics
System that samples all registered metric providers and updates current values. The system only runs if PerfHudSettings is present and enabled.
setup_hud
Startup system that creates all HUD UI entities and materials. The system only runs if PerfHudSettings is present and enabled.
sync_hud_visibility
System that synchronizes HUD visibility with the latest settings.
update_graph_and_bars
System that updates graph and bar displays with current performance data. The system only runs if both PerfHudSettings and HudHandles are present.