
# Objective - Fixes #16892 ## Solution - Removed `TypeRegistryPlugin` (`Name` is now automatically registered with a default `App`) - Moved `TaskPoolPlugin` to `bevy_app` - Moved `FrameCountPlugin` to `bevy_diagnostic` - Deleted now-empty `bevy_core` ## Testing - CI ## Migration Guide - `TypeRegistryPlugin` no longer exists. If you can't use a default `App` but still need `Name` registered, do so manually with `app.register_type::<Name>()`. - References to `TaskPoolPlugin` and associated types will need to import it from `bevy_app` instead of `bevy_core` - References to `FrameCountPlugin` and associated types will need to import it from `bevy_diagnostic` instead of `bevy_core` ## Notes This strategy was agreed upon by Cart and several other members in [Discord](https://discord.com/channels/691052431525675048/692572690833473578/1319137218312278077).
49 lines
1.7 KiB
Rust
49 lines
1.7 KiB
Rust
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
|
#![forbid(unsafe_code)]
|
|
#![doc(
|
|
html_logo_url = "https://bevyengine.org/assets/icon.png",
|
|
html_favicon_url = "https://bevyengine.org/assets/icon.png"
|
|
)]
|
|
|
|
//! This crate provides a straightforward solution for integrating diagnostics in the [Bevy game engine](https://bevyengine.org/).
|
|
//! It allows users to easily add diagnostic functionality to their Bevy applications, enhancing
|
|
//! their ability to monitor and optimize their game's.
|
|
|
|
extern crate alloc;
|
|
|
|
mod diagnostic;
|
|
mod entity_count_diagnostics_plugin;
|
|
mod frame_count_diagnostics_plugin;
|
|
mod frame_time_diagnostics_plugin;
|
|
mod log_diagnostics_plugin;
|
|
#[cfg(feature = "sysinfo_plugin")]
|
|
mod system_information_diagnostics_plugin;
|
|
|
|
pub use diagnostic::*;
|
|
|
|
pub use entity_count_diagnostics_plugin::EntityCountDiagnosticsPlugin;
|
|
pub use frame_count_diagnostics_plugin::{update_frame_count, FrameCount, FrameCountPlugin};
|
|
pub use frame_time_diagnostics_plugin::FrameTimeDiagnosticsPlugin;
|
|
pub use log_diagnostics_plugin::LogDiagnosticsPlugin;
|
|
#[cfg(feature = "sysinfo_plugin")]
|
|
pub use system_information_diagnostics_plugin::{SystemInfo, SystemInformationDiagnosticsPlugin};
|
|
|
|
use bevy_app::prelude::*;
|
|
|
|
/// Adds core diagnostics resources to an App.
|
|
#[derive(Default)]
|
|
pub struct DiagnosticsPlugin;
|
|
|
|
impl Plugin for DiagnosticsPlugin {
|
|
fn build(&self, app: &mut App) {
|
|
app.init_resource::<DiagnosticsStore>();
|
|
|
|
#[cfg(feature = "sysinfo_plugin")]
|
|
app.init_resource::<SystemInfo>();
|
|
}
|
|
}
|
|
|
|
/// Default max history length for new diagnostics.
|
|
pub const DEFAULT_MAX_HISTORY_LENGTH: usize = 120;
|