Skip to content
Snippets Groups Projects
Commit 05637de8 authored by Andrew xia's avatar Andrew xia Committed by jerryshao
Browse files

Change class xxxInstrumentation to class xxxSource

parent 5b4a2f20
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act ...@@ -58,7 +58,7 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act
Utils.checkHost(host, "Expected hostname") Utils.checkHost(host, "Expected hostname")
val masterInstrumentation = new MasterInstrumentation(this) val masterSource = new MasterSource(this)
val masterPublicAddress = { val masterPublicAddress = {
val envVar = System.getenv("SPARK_PUBLIC_DNS") val envVar = System.getenv("SPARK_PUBLIC_DNS")
...@@ -77,7 +77,7 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act ...@@ -77,7 +77,7 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act
webUi.start() webUi.start()
context.system.scheduler.schedule(0 millis, WORKER_TIMEOUT millis)(timeOutDeadWorkers()) context.system.scheduler.schedule(0 millis, WORKER_TIMEOUT millis)(timeOutDeadWorkers())
Master.metricsSystem.registerSource(masterInstrumentation) Master.metricsSystem.registerSource(masterSource)
Master.metricsSystem.start() Master.metricsSystem.start()
} }
......
...@@ -4,7 +4,7 @@ import com.codahale.metrics.{Gauge,MetricRegistry} ...@@ -4,7 +4,7 @@ import com.codahale.metrics.{Gauge,MetricRegistry}
import spark.metrics.source.Source import spark.metrics.source.Source
private[spark] class MasterInstrumentation(val master: Master) extends Source { private[spark] class MasterSource(val master: Master) extends Source {
val metricRegistry = new MetricRegistry() val metricRegistry = new MetricRegistry()
val sourceName = "master" val sourceName = "master"
......
...@@ -68,7 +68,7 @@ private[spark] class Worker( ...@@ -68,7 +68,7 @@ private[spark] class Worker(
var coresUsed = 0 var coresUsed = 0
var memoryUsed = 0 var memoryUsed = 0
val workerInstrumentation = new WorkerInstrumentation(this) val workerSource = new WorkerSource(this)
def coresFree: Int = cores - coresUsed def coresFree: Int = cores - coresUsed
def memoryFree: Int = memory - memoryUsed def memoryFree: Int = memory - memoryUsed
...@@ -102,7 +102,7 @@ private[spark] class Worker( ...@@ -102,7 +102,7 @@ private[spark] class Worker(
connectToMaster() connectToMaster()
startWebUi() startWebUi()
Worker.metricsSystem.registerSource(workerInstrumentation) Worker.metricsSystem.registerSource(workerSource)
Worker.metricsSystem.start() Worker.metricsSystem.start()
} }
......
...@@ -4,7 +4,7 @@ import com.codahale.metrics.{Gauge, MetricRegistry} ...@@ -4,7 +4,7 @@ import com.codahale.metrics.{Gauge, MetricRegistry}
import spark.metrics.source.Source import spark.metrics.source.Source
private[spark] class WorkerInstrumentation(val worker: Worker) extends Source { private[spark] class WorkerSource(val worker: Worker) extends Source {
val sourceName = "worker" val sourceName = "worker"
val metricRegistry = new MetricRegistry() val metricRegistry = new MetricRegistry()
......
...@@ -87,12 +87,12 @@ private[spark] class Executor(executorId: String, slaveHostname: String, propert ...@@ -87,12 +87,12 @@ private[spark] class Executor(executorId: String, slaveHostname: String, propert
} }
) )
val executorInstrumentation = new ExecutorInstrumentation(this) val executorSource = new ExecutorSource(this)
// Initialize Spark environment (using system properties read above) // Initialize Spark environment (using system properties read above)
val env = SparkEnv.createFromSystemProperties(executorId, slaveHostname, 0, false, false) val env = SparkEnv.createFromSystemProperties(executorId, slaveHostname, 0, false, false)
SparkEnv.set(env) SparkEnv.set(env)
env.metricsSystem.registerSource(executorInstrumentation) env.metricsSystem.registerSource(executorSource)
private val akkaFrameSize = env.actorSystem.settings.config.getBytes("akka.remote.netty.message-frame-size") private val akkaFrameSize = env.actorSystem.settings.config.getBytes("akka.remote.netty.message-frame-size")
......
...@@ -4,7 +4,7 @@ import com.codahale.metrics.{Gauge, MetricRegistry} ...@@ -4,7 +4,7 @@ import com.codahale.metrics.{Gauge, MetricRegistry}
import spark.metrics.source.Source import spark.metrics.source.Source
class ExecutorInstrumentation(val executor: Executor) extends Source { class ExecutorSource(val executor: Executor) extends Source {
val metricRegistry = new MetricRegistry() val metricRegistry = new MetricRegistry()
val sourceName = "executor" val sourceName = "executor"
......
...@@ -33,7 +33,7 @@ class MetricsSystemSuite extends FunSuite with BeforeAndAfter { ...@@ -33,7 +33,7 @@ class MetricsSystemSuite extends FunSuite with BeforeAndAfter {
assert(sources.length === 1) assert(sources.length === 1)
assert(sinks.length === 2) assert(sinks.length === 2)
val source = new spark.deploy.master.MasterInstrumentation(null) val source = new spark.deploy.master.MasterSource(null)
metricsSystem.registerSource(source) metricsSystem.registerSource(source)
assert(sources.length === 2) assert(sources.length === 2)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment