aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zma...@apache.org
Subject aurora git commit: Fix scheduler_framework_disconnects stat.
Date Mon, 27 Feb 2017 19:04:51 GMT
Repository: aurora
Updated Branches:
  refs/heads/master fadfd554d -> 2652fe02a


Fix scheduler_framework_disconnects stat.

Refactoring in r/31550 has disabled incrementing scheduler_framework_disconnects
stats. This change brings it back.

Testing Done:
Added a check to `MesosSchedulerImplTest.testDisconnected()`. Manually verified
in Vagrant by starting/stopping mesos-master and querying `/vars` endpoint.

Bugs closed: AURORA-1860

Reviewed at https://reviews.apache.org/r/57074/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/2652fe02
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/2652fe02
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/2652fe02

Branch: refs/heads/master
Commit: 2652fe02a2255992e187fede2bae8ff6aef2862c
Parents: fadfd55
Author: Ilya Pronin <ipronin@twopensource.com>
Authored: Mon Feb 27 11:04:54 2017 -0800
Committer: Zameer Manji <zmanji@apache.org>
Committed: Mon Feb 27 11:04:54 2017 -0800

----------------------------------------------------------------------
 .../org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java     | 2 +-
 .../org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/2652fe02/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java b/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
index 1730103..eb21096 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
@@ -170,7 +170,7 @@ public class MesosSchedulerImpl implements Scheduler {
   @Override
   public void disconnected(SchedulerDriver schedulerDriver) {
     log.warn("Framework disconnected.");
-    counters.get("scheduler_framework_disconnects").get();
+    counters.get("scheduler_framework_disconnects").incrementAndGet();
     eventSink.post(new DriverDisconnected());
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/2652fe02/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java b/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java
index 9bb319b..c599fe3 100644
--- a/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java
@@ -164,7 +164,7 @@ public class MesosSchedulerImplTest extends EasyMockTest {
         offerManager,
         eventSink,
         MoreExecutors.sameThreadExecutor(),
-        new CachedCounters(new FakeStatsProvider()),
+        new CachedCounters(statsProvider),
         logger,
         statsProvider);
     driver = createMock(SchedulerDriver.class);
@@ -298,6 +298,7 @@ public class MesosSchedulerImplTest extends EasyMockTest {
       @Override
       void test() {
         scheduler.disconnected(driver);
+        assertEquals(1L, statsProvider.getLongValue("scheduler_framework_disconnects"));
       }
     }.run();
   }


Mime
View raw message