Skip to content

Commit 1d03a26

Browse files
committed
[SPARK-2950] Add gc time and shuffle write time to JobLogger
The JobLogger is very useful for performing offline performance profiling of Spark jobs. GC Time and Shuffle Write time are available in TaskMetrics but are currently missed from the JobLogger output. This patch adds these two fields. ~~Since this is a small change, I didn't create a JIRA. Let me know if I should do that.~~ cc kayousterhout Author: Shivaram Venkataraman <[email protected]> Closes apache#1869 from shivaram/job-logger and squashes the following commits: 1b709fc [Shivaram Venkataraman] Add a space before GC_TIME c418105 [Shivaram Venkataraman] Add gc time and shuffle write time to JobLogger
1 parent 3570119 commit 1d03a26

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/src/main/scala/org/apache/spark/scheduler/JobLogger.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ class JobLogger(val user: String, val logDirName: String) extends SparkListener
162162
" START_TIME=" + taskInfo.launchTime + " FINISH_TIME=" + taskInfo.finishTime +
163163
" EXECUTOR_ID=" + taskInfo.executorId + " HOST=" + taskMetrics.hostname
164164
val executorRunTime = " EXECUTOR_RUN_TIME=" + taskMetrics.executorRunTime
165+
val gcTime = " GC_TIME=" + taskMetrics.jvmGCTime
165166
val inputMetrics = taskMetrics.inputMetrics match {
166167
case Some(metrics) =>
167168
" READ_METHOD=" + metrics.readMethod.toString +
@@ -179,11 +180,13 @@ class JobLogger(val user: String, val logDirName: String) extends SparkListener
179180
case None => ""
180181
}
181182
val writeMetrics = taskMetrics.shuffleWriteMetrics match {
182-
case Some(metrics) => " SHUFFLE_BYTES_WRITTEN=" + metrics.shuffleBytesWritten
183+
case Some(metrics) =>
184+
" SHUFFLE_BYTES_WRITTEN=" + metrics.shuffleBytesWritten +
185+
" SHUFFLE_WRITE_TIME=" + metrics.shuffleWriteTime
183186
case None => ""
184187
}
185-
stageLogInfo(stageId, status + info + executorRunTime + inputMetrics + shuffleReadMetrics +
186-
writeMetrics)
188+
stageLogInfo(stageId, status + info + executorRunTime + gcTime + inputMetrics +
189+
shuffleReadMetrics + writeMetrics)
187190
}
188191

189192
/**

0 commit comments

Comments
 (0)