aboutsummaryrefslogtreecommitdiff
path: root/sql/catalyst/src/main/java
diff options
context:
space:
mode:
authorEric Liang <ekl@databricks.com>2016-05-11 11:25:46 -0700
committerDavies Liu <davies.liu@gmail.com>2016-05-11 11:25:46 -0700
commit6d0368ab8d1043735e5fe89f801aae1c6826876c (patch)
treeeba9c39405dc0d7bd9a4f2cf10af7e494d6a6742 /sql/catalyst/src/main/java
parent29314379729de4082bd2297c9e5289e3e4a0115e (diff)
downloadspark-6d0368ab8d1043735e5fe89f801aae1c6826876c.tar.gz
spark-6d0368ab8d1043735e5fe89f801aae1c6826876c.tar.bz2
spark-6d0368ab8d1043735e5fe89f801aae1c6826876c.zip
[SPARK-15259] Sort time metric should not include spill and record insertion time
## What changes were proposed in this pull request? After SPARK-14669 it seems the sort time metric includes both spill and record insertion time. This makes it not very useful since the metric becomes close to the total execution time of the node. We should track just the time spent for in-memory sort, as before. ## How was this patch tested? Verified metric in the UI, also unit test on UnsafeExternalRowSorter. cc davies Author: Eric Liang <ekl@databricks.com> Author: Eric Liang <ekhliang@gmail.com> Closes #13035 from ericl/fix-metrics.
Diffstat (limited to 'sql/catalyst/src/main/java')
-rw-r--r--sql/catalyst/src/main/java/org/apache/spark/sql/execution/UnsafeExternalRowSorter.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/catalyst/src/main/java/org/apache/spark/sql/execution/UnsafeExternalRowSorter.java b/sql/catalyst/src/main/java/org/apache/spark/sql/execution/UnsafeExternalRowSorter.java
index 8d9906da7e..37fbad47c1 100644
--- a/sql/catalyst/src/main/java/org/apache/spark/sql/execution/UnsafeExternalRowSorter.java
+++ b/sql/catalyst/src/main/java/org/apache/spark/sql/execution/UnsafeExternalRowSorter.java
@@ -108,6 +108,13 @@ public final class UnsafeExternalRowSorter {
return sorter.getPeakMemoryUsedBytes();
}
+ /**
+ * @return the total amount of time spent sorting data (in-memory only).
+ */
+ public long getSortTimeNanos() {
+ return sorter.getSortTimeNanos();
+ }
+
private void cleanupResources() {
sorter.cleanupResources();
}