@@ -20,17 +20,17 @@ use std::sync::Arc;
2020pub struct TaskMetricsCollector {
2121 /// metrics contains the metrics for the current task.
2222 task_metrics : Vec < MetricsSet > ,
23- /// child_task_metrics contains metrics for tasks from child [StageExec]s if they were
23+ /// input_task_metrics contains metrics for tasks from child [StageExec]s if they were
2424 /// collected.
25- child_task_metrics : HashMap < StageKey , Vec < MetricsSetProto > > ,
25+ input_task_metrics : HashMap < StageKey , Vec < MetricsSetProto > > ,
2626}
2727
2828/// MetricsCollectorResult is the result of collecting metrics from a task.
2929pub struct MetricsCollectorResult {
3030 // metrics is a collection of metrics for a task ordered using a pre-order traversal of the task's plan.
3131 pub task_metrics : Vec < MetricsSet > ,
32- // child_task_metrics contains metrics for child tasks if they were collected.
33- pub child_task_metrics : HashMap < StageKey , Vec < MetricsSetProto > > ,
32+ // input_task_metrics contains metrics for child tasks if they were collected.
33+ pub input_task_metrics : HashMap < StageKey , Vec < MetricsSetProto > > ,
3434}
3535
3636impl TreeNodeRewriter for TaskMetricsCollector {
@@ -62,7 +62,7 @@ impl TreeNodeRewriter for TaskMetricsCollector {
6262 for mut entry in metrics_collection. iter_mut ( ) {
6363 let stage_key = entry. key ( ) . clone ( ) ;
6464 let task_metrics = std:: mem:: take ( entry. value_mut ( ) ) ; // Avoid copy.
65- match self . child_task_metrics . get ( & stage_key) {
65+ match self . input_task_metrics . get ( & stage_key) {
6666 // There should never be two NetworkShuffleExec with metrics for the same stage_key.
6767 // By convention, the NetworkShuffleExec which runs the last partition in a task should be
6868 // sent metrics (the NetworkShuffleExec tracks it for us).
@@ -73,7 +73,7 @@ impl TreeNodeRewriter for TaskMetricsCollector {
7373 ) ;
7474 }
7575 None => {
76- self . child_task_metrics
76+ self . input_task_metrics
7777 . insert ( stage_key. clone ( ) , task_metrics) ;
7878 }
7979 }
@@ -98,7 +98,7 @@ impl TaskMetricsCollector {
9898 pub fn new ( ) -> Self {
9999 Self {
100100 task_metrics : Vec :: new ( ) ,
101- child_task_metrics : HashMap :: new ( ) ,
101+ input_task_metrics : HashMap :: new ( ) ,
102102 }
103103 }
104104
@@ -113,7 +113,7 @@ impl TaskMetricsCollector {
113113 plan. rewrite ( & mut self ) ?;
114114 Ok ( MetricsCollectorResult {
115115 task_metrics : self . task_metrics ,
116- child_task_metrics : self . child_task_metrics ,
116+ input_task_metrics : self . input_task_metrics ,
117117 } )
118118 }
119119}
@@ -265,7 +265,7 @@ mod tests {
265265 // Collect metrics for all tasks from the root StageExec.
266266 let collector = TaskMetricsCollector :: new ( ) ;
267267 let result = collector. collect ( stage_exec. plan . clone ( ) ) . unwrap ( ) ;
268- let mut actual_collected_metrics = result. child_task_metrics ;
268+ let mut actual_collected_metrics = result. input_task_metrics ;
269269 actual_collected_metrics. insert (
270270 StageKey {
271271 query_id : stage_exec. query_id . to_string ( ) ,
0 commit comments