File tree Expand file tree Collapse file tree
core/src/main/scala/org/apache/spark/deploy/master Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,4 +38,26 @@ private[master] class ApplicationSource(val application: ApplicationInfo) extend
3838 override def getValue : Int = application.coresGranted
3939 })
4040
41+ metricRegistry.register(MetricRegistry .name(" cores_per_executor" ), new Gauge [Int ] {
42+ override def getValue : Int = application.desc.coresPerExecutor.getOrElse(1 )
43+ })
44+
45+ metricRegistry.register(MetricRegistry .name(" max_cores" ), new Gauge [Int ] {
46+ override def getValue : Int = application.desc.maxCores.getOrElse(0 )
47+ })
48+
49+ metricRegistry.register(MetricRegistry .name(" instances" ), new Gauge [Int ] {
50+ val maxCores : Int = application.desc.maxCores.getOrElse(0 )
51+ val coresPerExecutor : Int = application.desc.coresPerExecutor.getOrElse(1 )
52+ override def getValue : Int = maxCores / coresPerExecutor
53+ })
54+
55+ metricRegistry.register(MetricRegistry .name(" request_executors" ), new Gauge [Int ] {
56+ override def getValue : Int = application.executorLimit
57+ })
58+
59+ metricRegistry.register(MetricRegistry .name(" executors" ), new Gauge [Int ] {
60+ override def getValue : Int = application.executors.size
61+ })
62+
4163}
You can’t perform that action at this time.
0 commit comments