Skip to content

Commit 01e7650

Browse files
author
Marcelo Vanzin
committed
[SPARK-11828] [core] Register DAGScheduler metrics source after app id is known.
1 parent dbf428c commit 01e7650

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
581581

582582
// Post init
583583
_taskScheduler.postStartHook()
584+
_env.metricsSystem.registerSource(_dagScheduler.metricsSource)
584585
_env.metricsSystem.registerSource(new BlockManagerSource(_env.blockManager))
585586
_executorAllocationManager.foreach { e =>
586587
_env.metricsSystem.registerSource(e.executorAllocationManagerSource)

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class DAGScheduler(
130130

131131
def this(sc: SparkContext) = this(sc, sc.taskScheduler)
132132

133-
private[scheduler] val metricsSource: DAGSchedulerSource = new DAGSchedulerSource(this)
133+
private[spark] val metricsSource: DAGSchedulerSource = new DAGSchedulerSource(this)
134134

135135
private[scheduler] val nextJobId = new AtomicInteger(0)
136136
private[scheduler] def numTotalJobs: Int = nextJobId.get()
@@ -1580,8 +1580,6 @@ class DAGScheduler(
15801580
taskScheduler.stop()
15811581
}
15821582

1583-
// Start the event thread and register the metrics source at the end of the constructor
1584-
env.metricsSystem.registerSource(metricsSource)
15851583
eventProcessLoop.start()
15861584
}
15871585

0 commit comments

Comments
 (0)