@@ -519,26 +519,31 @@ impl BatchEngine {
519519 #[ allow( clippy:: unused_self) ]
520520 fn check_memory_pressure ( & self ) {
521521 #[ cfg( feature = "memory" ) ]
522- if let Some ( guard) = & self . memory_guard {
523- if guard. under_pressure ( ) {
524- tracing:: warn!( "BatchEngine: memory pressure detected, pausing between chunks" ) ;
525- std:: thread:: sleep ( std:: time:: Duration :: from_millis (
526- self . config . memory_pressure_pause_ms ,
527- ) ) ;
528- }
522+ if let Some ( guard) = & self . memory_guard
523+ && guard. under_pressure ( )
524+ {
525+ tracing:: warn!(
526+ pause_ms = self . config. memory_pressure_pause_ms,
527+ "BatchEngine: memory pressure detected, pausing between chunks"
528+ ) ;
529+ std:: thread:: sleep ( std:: time:: Duration :: from_millis (
530+ self . config . memory_pressure_pause_ms ,
531+ ) ) ;
529532 }
530533 }
531534}
532535
533536impl std:: fmt:: Debug for BatchEngine {
534537 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
535- f. debug_struct ( "BatchEngine" )
536- . field ( "config" , & self . config )
538+ let mut s = f. debug_struct ( "BatchEngine" ) ;
539+ s . field ( "config" , & self . config )
537540 . field ( "pool_max_threads" , & self . pool . max_threads ( ) )
538541 . field ( "stats" , & self . stats . snapshot ( ) )
539542 . field ( "interner_len" , & self . interner . len ( ) )
540- . field ( "filters" , & self . filters )
541- . finish ( )
543+ . field ( "filters" , & self . filters ) ;
544+ #[ cfg( feature = "memory" ) ]
545+ s. field ( "memory_guard" , & self . memory_guard . is_some ( ) ) ;
546+ s. finish ( )
542547 }
543548}
544549
0 commit comments