Spenserrrr commented on code in PR #59892:
URL: https://github.com/apache/spark/pull/59892#discussion_r4416865844


##########
python/pyspark/worker_metrics.py:
##########
@@ -121,14 +123,23 @@ def measure(self, name: str) -> _WorkerTimer:
         self._duration_totals_ns.setdefault(name, 0)
         return _WorkerTimer(self._duration_totals_ns, name)
 
+    def subtract_duration_at_report(self, *, total_metric: str, nested_metric: 
str) -> None:
+        """Subtract nested_metric from total_metric at report time without 
registering either."""
+        self._duration_subtractions[total_metric] = nested_metric

Review Comment:
   Yeah that's a good point. I renamed this to 
record_sub_duration(parent_metric=..., sub_metric=...). It records the nesting 
relationship without registering metrics or changing raw duration totals. 
Reporting handles the calculation of exclusive durations separately.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to