aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject aurora git commit: Add timing metrics in MesosCallbackHandler for backward compatibility.
Date Fri, 04 Aug 2017 16:05:49 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 65257d63b -> aae2b0dc7


Add timing metrics in MesosCallbackHandler for backward compatibility.

We have an internal performance dashboard that reads the following timing metrics:
```
scheduler_resource_offers,
scheduler_framework_message,
scheduler_status_update
```
Currently, these timing metrics merely reside in MesosSchedulerImpl class. If we
were to enable the Mesos HTTP API in aurora(switch from __MesosSchedulerImpl__
to __VersionedMesosSchedulerImpl__), we will lose the timing metrics in
MesosSchedulerImpl. This CR migrates the missing timing metrics from MesosSchedulerImpl
to MesosCallbackHandler, so that the above timing metrics will be visible after enabling
Mesos HTTP API.

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


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

Branch: refs/heads/master
Commit: aae2b0dc73b7534c66982ed07b1f029150e245de
Parents: 65257d6
Author: Kai Huang <texasred2013@hotmail.com>
Authored: Fri Aug 4 17:58:22 2017 +0200
Committer: Stephan Erb <serb@apache.org>
Committed: Fri Aug 4 17:58:22 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/aurora/blob/aae2b0dc/src/main/java/org/apache/aurora/scheduler/mesos/MesosCallbackHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/mesos/MesosCallbackHandler.java b/src/main/java/org/apache/aurora/scheduler/mesos/MesosCallbackHandler.java
index 60df46c..2a42cac 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/MesosCallbackHandler.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/MesosCallbackHandler.java
@@ -25,7 +25,9 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
 import com.google.common.base.Optional;
 
+import org.apache.aurora.GuiceUtils.AllowUnchecked;
 import org.apache.aurora.common.application.Lifecycle;
+import org.apache.aurora.common.inject.TimedInterceptor.Timed;
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
 import org.apache.aurora.common.stats.StatsProvider;
@@ -197,6 +199,7 @@ public interface MesosCallbackHandler {
       reRegisters.incrementAndGet();
     }
 
+    @Timed("scheduler_resource_offers")
     @Override
     public void handleOffers(List<Offer> offers) {
       // Don't invoke the executor or storage lock if the list of offers is empty.
@@ -244,6 +247,7 @@ public interface MesosCallbackHandler {
       eventSink.post(new PubsubEvent.DriverDisconnected());
     }
 
+    @Timed("scheduler_framework_message")
     @Override
     public void handleMessage(ExecutorID executorID, AgentID agentID) {
       log.warn(
@@ -287,6 +291,8 @@ public interface MesosCallbackHandler {
     private static final Function<Double, Long> SECONDS_TO_MICROS =
         seconds -> (long) (seconds * 1E6);
 
+    @AllowUnchecked
+    @Timed("scheduler_status_update")
     @Override
     public void handleUpdate(TaskStatus status) {
       logStatusUpdate(log, status);

http://git-wip-us.apache.org/repos/asf/aurora/blob/aae2b0dc/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 c3a34d2..7cd2468 100644
--- a/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImpl.java
@@ -19,8 +19,6 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.Lists;
 import com.google.inject.Inject;
 
-import org.apache.aurora.GuiceUtils.AllowUnchecked;
-import org.apache.aurora.common.inject.TimedInterceptor.Timed;
 import org.apache.mesos.Protos.ExecutorID;
 import org.apache.mesos.Protos.FrameworkID;
 import org.apache.mesos.Protos.MasterInfo;
@@ -74,7 +72,6 @@ public class MesosSchedulerImpl implements Scheduler {
     handler.handleReregistration(convert(masterInfo));
   }
 
-  @Timed("scheduler_resource_offers")
   @Override
   public void resourceOffers(SchedulerDriver driver, final List<Offer> offers) {
     checkState(isRegistered, "Must be registered before receiving offers.");
@@ -86,8 +83,6 @@ public class MesosSchedulerImpl implements Scheduler {
     handler.handleRescind(convert(offerId));
   }
 
-  @AllowUnchecked
-  @Timed("scheduler_status_update")
   @Override
   public void statusUpdate(SchedulerDriver driver, TaskStatus status) {
     handler.handleUpdate(convert(status));
@@ -104,7 +99,6 @@ public class MesosSchedulerImpl implements Scheduler {
     handler.handleLostExecutor(convert(executorID), convert(slaveID), status);
   }
 
-  @Timed("scheduler_framework_message")
   @Override
   public void frameworkMessage(
       SchedulerDriver driver,


Mime
View raw message