Add a tracing span for run criteria. (#4709)
# Objective Adds a tracing span for run critieria. This change will be invalidated by stageless, but it was a simple change. Fixes #4681. ## Changelog Shows how long a run criteria takes to run when tracing is enabled. 
This commit is contained in:
		
							parent
							
								
									e503a31048
								
							
						
					
					
						commit
						9a54e2bed6
					
				@ -802,6 +802,12 @@ impl Stage for SystemStage {
 | 
			
		||||
            for index in 0..self.run_criteria.len() {
 | 
			
		||||
                let (run_criteria, tail) = self.run_criteria.split_at_mut(index);
 | 
			
		||||
                let mut criteria = &mut tail[0];
 | 
			
		||||
 | 
			
		||||
                #[cfg(feature = "trace")]
 | 
			
		||||
                let _span =
 | 
			
		||||
                    bevy_utils::tracing::info_span!("run criteria", name = &*criteria.name())
 | 
			
		||||
                        .entered();
 | 
			
		||||
 | 
			
		||||
                match &mut criteria.inner {
 | 
			
		||||
                    RunCriteriaInner::Single(system) => criteria.should_run = system.run((), world),
 | 
			
		||||
                    RunCriteriaInner::Piped {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user