Skip to content

Commit 33ca780

Browse files
rename child_task_metrics to input_task_metrics
1 parent 39b07f5 commit 33ca780

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/flight_service/do_get.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,12 @@ pub fn collect_and_create_metrics_flight_data(
231231
})
232232
.collect::<Result<Vec<_>, _>>()?;
233233
result
234-
.child_task_metrics
234+
.input_task_metrics
235235
.insert(stage_key, proto_task_metrics);
236236

237237
// Serialize the metrics for all tasks.
238238
let mut task_metrics_set = vec![];
239-
for (stage_key, metrics) in result.child_task_metrics.into_iter() {
239+
for (stage_key, metrics) in result.input_task_metrics.into_iter() {
240240
task_metrics_set.push(TaskMetrics {
241241
stage_key: Some(stage_key),
242242
metrics,

src/metrics/task_metrics_collector.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ use std::sync::Arc;
2020
pub 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.
2929
pub 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

3636
impl 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

Comments
 (0)