@@ -322,6 +322,7 @@ async fn evaluate_child_op_scope(
322322 child_scope_entry : ScopeEntry < ' _ > ,
323323 concurrency_controller : & concur_control:: ConcurrencyController ,
324324 memory : & EvaluationMemory ,
325+ operation_in_process_stats : Option < & crate :: execution:: stats:: OperationInProcessStats > ,
325326) -> Result < ( ) > {
326327 let _permit = concurrency_controller
327328 . acquire ( Some ( || {
@@ -333,32 +334,44 @@ async fn evaluate_child_op_scope(
333334 . sum ( )
334335 } ) )
335336 . await ?;
336- evaluate_op_scope ( op_scope, scoped_entries. prepend ( & child_scope_entry) , memory)
337- . await
338- . with_context ( || {
339- format ! (
340- "Evaluating in scope with key {}" ,
341- match child_scope_entry. key. key( ) {
342- Some ( k) => k. to_string( ) ,
343- None => "()" . to_string( ) ,
344- }
345- )
346- } )
337+ evaluate_op_scope (
338+ op_scope,
339+ scoped_entries. prepend ( & child_scope_entry) ,
340+ memory,
341+ operation_in_process_stats,
342+ )
343+ . await
344+ . with_context ( || {
345+ format ! (
346+ "Evaluating in scope with key {}" ,
347+ match child_scope_entry. key. key( ) {
348+ Some ( k) => k. to_string( ) ,
349+ None => "()" . to_string( ) ,
350+ }
351+ )
352+ } )
347353}
348354
349355async fn evaluate_op_scope (
350356 op_scope : & AnalyzedOpScope ,
351357 scoped_entries : RefList < ' _ , & ScopeEntry < ' _ > > ,
352358 memory : & EvaluationMemory ,
359+ operation_in_process_stats : Option < & crate :: execution:: stats:: OperationInProcessStats > ,
353360) -> Result < ( ) > {
354361 let head_scope = * scoped_entries. head ( ) . unwrap ( ) ;
355362 for reactive_op in op_scope. reactive_ops . iter ( ) {
356363 match reactive_op {
357364 AnalyzedReactiveOp :: Transform ( op) => {
365+ // Track transform operation start
366+ if let Some ( ref op_stats) = operation_in_process_stats {
367+ op_stats. start_processing ( & op. name , 1 ) ;
368+ }
369+
358370 let mut input_values = Vec :: with_capacity ( op. inputs . len ( ) ) ;
359371 input_values
360372 . extend ( assemble_input_values ( & op. inputs , scoped_entries) . collect :: < Vec < _ > > ( ) ) ;
361- if op. function_exec_info . enable_cache {
373+
374+ let result = if op. function_exec_info . enable_cache {
362375 let output_value_cell = memory. get_cache_entry (
363376 || {
364377 Ok ( op
@@ -382,7 +395,14 @@ async fn evaluate_op_scope(
382395 . await
383396 . and_then ( |v| head_scope. define_field ( & op. output , & v) )
384397 }
385- . with_context ( || format ! ( "Evaluating Transform op `{}`" , op. name, ) ) ?
398+ . with_context ( || format ! ( "Evaluating Transform op `{}`" , op. name, ) ) ;
399+
400+ // Track transform operation completion
401+ if let Some ( ref op_stats) = operation_in_process_stats {
402+ op_stats. finish_processing ( & op. name , 1 ) ;
403+ }
404+
405+ result?
386406 }
387407
388408 AnalyzedReactiveOp :: ForEach ( op) => {
@@ -408,6 +428,7 @@ async fn evaluate_op_scope(
408428 ) ,
409429 & op. concurrency_controller ,
410430 memory,
431+ operation_in_process_stats,
411432 )
412433 } )
413434 . collect :: < Vec < _ > > ( ) ,
@@ -425,6 +446,7 @@ async fn evaluate_op_scope(
425446 ) ,
426447 & op. concurrency_controller ,
427448 memory,
449+ operation_in_process_stats,
428450 )
429451 } )
430452 . collect :: < Vec < _ > > ( ) ,
@@ -443,6 +465,7 @@ async fn evaluate_op_scope(
443465 ) ,
444466 & op. concurrency_controller ,
445467 memory,
468+ operation_in_process_stats,
446469 )
447470 } )
448471 . collect :: < Vec < _ > > ( ) ,
@@ -509,6 +532,7 @@ pub async fn evaluate_source_entry(
509532 src_eval_ctx : & SourceRowEvaluationContext < ' _ > ,
510533 source_value : value:: FieldValues ,
511534 memory : & EvaluationMemory ,
535+ operation_in_process_stats : Option < & crate :: execution:: stats:: OperationInProcessStats > ,
512536) -> Result < EvaluateSourceEntryOutput > {
513537 let _permit = src_eval_ctx
514538 . import_op
@@ -556,6 +580,7 @@ pub async fn evaluate_source_entry(
556580 & src_eval_ctx. plan . op_scope ,
557581 RefList :: Nil . prepend ( & root_scope_entry) ,
558582 memory,
583+ operation_in_process_stats,
559584 )
560585 . await ?;
561586 let collected_values = root_scope_entry
@@ -604,6 +629,7 @@ pub async fn evaluate_transient_flow(
604629 & flow. execution_plan . op_scope ,
605630 RefList :: Nil . prepend ( & root_scope_entry) ,
606631 & eval_memory,
632+ None , // No operation stats for transient flows
607633 )
608634 . await ?;
609635 let output_value = assemble_value (
0 commit comments