Skip to content

Commit

Permalink
#49 add more metrics to application-source
Browse files Browse the repository at this point in the history
  • Loading branch information
microbearz committed May 14, 2020
1 parent 792e9f7 commit dd5c019
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,26 @@ private[master] class ApplicationSource(val application: ApplicationInfo) extend
override def getValue: Int = application.coresGranted
})

metricRegistry.register(MetricRegistry.name("cores_per_executor"), new Gauge[Int] {
override def getValue: Int = application.desc.coresPerExecutor.getOrElse(1)
})

metricRegistry.register(MetricRegistry.name("max_cores"), new Gauge[Int] {
override def getValue: Int = application.desc.maxCores.getOrElse(0)
})

metricRegistry.register(MetricRegistry.name("instances"), new Gauge[Int] {
val maxCores: Int = application.desc.maxCores.getOrElse(0)
val coresPerExecutor: Int = application.desc.coresPerExecutor.getOrElse(1)
override def getValue: Int = maxCores / coresPerExecutor
})

metricRegistry.register(MetricRegistry.name("request_executors"), new Gauge[Int] {
override def getValue: Int = application.executorLimit
})

metricRegistry.register(MetricRegistry.name("executors"), new Gauge[Int] {
override def getValue: Int = application.executors.size
})

}

0 comments on commit dd5c019

Please sign in to comment.