Crate bevy_metrics_dashboard

Crate bevy_metrics_dashboard 

Source
Expand description

A metrics dashboard for Bevy.

This library enables Bevy apps to search and plot any metrics defined by the metrics crate within the app itself.

screen

§Should I use this?

This library is not a replacement for tools that export metrics into a monitoring service with a time series database, nor does it reject that methodology. This library is a supplemental tool that allows users to cheaply plot high-resolution metrics in real time within the app that defines them. As such, this tool shines when you are debugging an issue that is reproducible and requires real-time feedback or ad-hoc instrumentation.

§How does it work?

The metrics crate lets developers define metrics in their code using simple macros. Each process has a global registry (AKA “recorder”) of all of the metrics that have been used or described in code.

The provided Bevy plugin defines and installs a registry, and the dashboard widget lets users search the registry and plot metrics.

§Getting Started

See the “examples” directory.

Steps for plotting your metrics:

  1. Define metrics using the metrics crate.
  2. Add the bevy_egui::EguiPlugin, RegistryPlugin, and DashboardPlugin to your app. You may need to enable the bevy_egui feature.
  3. Spawn an entity with the DashboardWindow component.

§Low-Level API

You can build your own metrics dashboard widgets by reusing building blocks like the search bar and plot widgets. Read the source code of DashboardWindow to see how it works.

§Version Support

bevy_metrics_dashboardbevyeguibevy_egui
0.80.160.320.36
0.70.160.310.34
0.60.150.310.33
0.50.150.31 + 0.300.32
0.40.150.300.32
0.30.140.31 + 0.290.30

Re-exports§

pub use egui;
pub use egui_plot;
pub use metrics;
pub use metrics_util;

Modules§

plots
Widgets for plotting metrics.
registry
The process-global metrics registry.

Structs§

CachedPlotConfigs
Cache of configs for plots that have been opened and removed.
ClearBucketsSystem
The SystemSet from which atomic buckets are cleared.
CoreMetricsPlugin
Provides core metrics like frame time, entity count, etc.
DashboardConfig
Configuration for a single DashboardWindow.
DashboardWindow
An egui window that can search for metrics and plot them.
NamespaceTreeWindow
A widget that shows all metrics metadata in a tree, grouped by namespace.
RegistryPlugin
Installs and garbage collects a MetricsRegistry.
RequestPlot
Event used to create a new plot in all DashboardWindow entities.
SearchBar
A widget that searches the MetricsRegistry with fuzzy string matching.