flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [2/5] flink git commit: [FLINK-4057] Slots/regTaskManagers/numJobs
Date Fri, 01 Jul 2016 13:09:29 GMT
[FLINK-4057] Slots/regTaskManagers/numJobs


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/8829f973
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/8829f973
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/8829f973

Branch: refs/heads/master
Commit: 8829f97344cd9a7a9cfdee4db3d55a2635ff1f31
Parents: fafb981
Author: zentol <chesnay@apache.org>
Authored: Wed Jun 15 12:30:22 2016 +0200
Committer: zentol <chesnay@apache.org>
Committed: Fri Jul 1 15:09:16 2016 +0200

----------------------------------------------------------------------
 .../apache/flink/runtime/jobmanager/JobManager.scala   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/8829f973/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
index 314977a..852b238 100644
--- a/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
+++ b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
@@ -1758,6 +1758,19 @@ class JobManager(
   }
 
   private def instantiateMetrics(jobManagerMetricGroup: MetricGroup) : Unit = {
+    jobManagerMetricGroup.gauge[Long, Gauge[Long]]("taskSlotsAvailable", new Gauge[Long]
{
+      override def getValue: Long = JobManager.this.instanceManager.getNumberOfAvailableSlots
+    })
+    jobManagerMetricGroup.gauge[Long, Gauge[Long]]("taskSlotsTotal", new Gauge[Long] {
+      override def getValue: Long = JobManager.this.instanceManager.getTotalNumberOfSlots
+    })
+    jobManagerMetricGroup.gauge[Long, Gauge[Long]]("numRegisteredTaskManagers", new Gauge[Long]
{
+      override def getValue: Long
+      = JobManager.this.instanceManager.getNumberOfRegisteredTaskManagers
+    })
+    jobManagerMetricGroup.gauge[Long, Gauge[Long]]("numRunningJobs", new Gauge[Long] {
+      override def getValue: Long = JobManager.this.currentJobs.size
+    })
     instantiateStatusMetrics(jobManagerMetricGroup)
   }
 


Mime
View raw message