mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 14:40:19 +00:00
320ac65a9e
# Objective Implements #9216 ## Solution - Replace `DiagnosticId` by `DiagnosticPath`. It's pre-hashed using `const-fnv1a-hash` crate, so it's possible to create path in const contexts. --- ## Changelog - Replaced `DiagnosticId` by `DiagnosticPath` - Set default history length to 120 measurements (2 seconds on 60 fps). I've noticed hardcoded constant 20 everywhere and decided to change it to `DEFAULT_MAX_HISTORY_LENGTH` , which is set to new diagnostics by default. To override it, use `with_max_history_length`. ## Migration Guide ```diff - const UNIQUE_DIAG_ID: DiagnosticId = DiagnosticId::from_u128(42); + const UNIQUE_DIAG_PATH: DiagnosticPath = DiagnosticPath::const_new("foo/bar"); - Diagnostic::new(UNIQUE_DIAG_ID, "example", 10) + Diagnostic::new(UNIQUE_DIAG_PATH).with_max_history_length(10) - diagnostics.add_measurement(UNIQUE_DIAG_ID, || 42); + diagnostics.add_measurement(&UNIQUE_DIAG_ID, || 42); ```
38 lines
1.3 KiB
TOML
38 lines
1.3 KiB
TOML
[package]
|
|
name = "bevy_diagnostic"
|
|
version = "0.12.0"
|
|
edition = "2021"
|
|
description = "Provides diagnostic functionality for Bevy Engine"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[features]
|
|
# Disables diagnostics that are unsupported when Bevy is dynamically linked
|
|
dynamic_linking = []
|
|
|
|
[dependencies]
|
|
# bevy
|
|
bevy_app = { path = "../bevy_app", version = "0.12.0" }
|
|
bevy_core = { path = "../bevy_core", version = "0.12.0" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.12.0" }
|
|
bevy_log = { path = "../bevy_log", version = "0.12.0" }
|
|
bevy_time = { path = "../bevy_time", version = "0.12.0" }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.12.0" }
|
|
|
|
const-fnv1a-hash = "1.1.0"
|
|
|
|
# MacOS
|
|
[target.'cfg(all(target_os="macos"))'.dependencies]
|
|
# Some features of sysinfo are not supported by apple. This will disable those features on apple devices
|
|
sysinfo = { version = "0.30.0", default-features = false, features = [
|
|
"apple-app-store",
|
|
] }
|
|
|
|
# Only include when not bevy_dynamic_plugin and on linux/windows/android
|
|
[target.'cfg(any(target_os = "linux", target_os = "windows", target_os = "android"))'.dependencies]
|
|
sysinfo = { version = "0.30.0", default-features = false }
|
|
|
|
[lints]
|
|
workspace = true
|