Skip to content

Commit 8c4f207

Browse files
hymmrobtfm
authored andcommitted
Add a tracing span for run criteria. (bevyengine#4709)
# Objective Adds a tracing span for run critieria. This change will be invalidated by stageless, but it was a simple change. Fixes bevyengine#4681. ## Changelog Shows how long a run criteria takes to run when tracing is enabled. ![image](https://user-images.githubusercontent.com/2180432/167517447-93dba7db-8c85-4686-90e0-30e9636f120f.png)
1 parent 3233ecc commit 8c4f207

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/bevy_ecs/src/schedule/stage.rs

+6
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,12 @@ impl Stage for SystemStage {
802802
for index in 0..self.run_criteria.len() {
803803
let (run_criteria, tail) = self.run_criteria.split_at_mut(index);
804804
let mut criteria = &mut tail[0];
805+
806+
#[cfg(feature = "trace")]
807+
let _span =
808+
bevy_utils::tracing::info_span!("run criteria", name = &*criteria.name())
809+
.entered();
810+
805811
match &mut criteria.inner {
806812
RunCriteriaInner::Single(system) => criteria.should_run = system.run((), world),
807813
RunCriteriaInner::Piped {

0 commit comments

Comments
 (0)