Skip to content

Commit

Permalink
[SPARK-22135][MESOS] metrics in spark-dispatcher not being registered…
Browse files Browse the repository at this point in the history
… properly

## What changes were proposed in this pull request?

Fix a trivial bug with how metrics are registered in the mesos dispatcher. Bug resulted in creating a new registry each time the metricRegistry() method was called.

## How was this patch tested?

Verified manually on local mesos setup

Author: Paul Mackles <pmackles@adobe.com>

Closes #19358 from pmackles/SPARK-22135.

(cherry picked from commit f20be4d)
Signed-off-by: jerryshao <sshao@hortonworks.com>
  • Loading branch information
Paul Mackles authored and jerryshao committed Sep 28, 2017
1 parent 42e1727 commit 12a74e3
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -23,8 +23,9 @@ import org.apache.spark.metrics.source.Source

private[mesos] class MesosClusterSchedulerSource(scheduler: MesosClusterScheduler)
extends Source {
override def sourceName: String = "mesos_cluster"
override def metricRegistry: MetricRegistry = new MetricRegistry()

override val sourceName: String = "mesos_cluster"
override val metricRegistry: MetricRegistry = new MetricRegistry()

metricRegistry.register(MetricRegistry.name("waitingDrivers"), new Gauge[Int] {
override def getValue: Int = scheduler.getQueuedDriversSize
Expand Down

0 comments on commit 12a74e3

Please sign in to comment.