aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsir...@apache.org
Subject aurora git commit: Fixup broken jmh benchmarks.
Date Tue, 19 Jan 2016 20:15:01 GMT
Repository: aurora
Updated Branches:
  refs/heads/master c96d5b8ad -> 0150312eb


Fixup broken jmh benchmarks.

The `TierConfig` binding fix for the `SchedulingBenchmarks` in
https://reviews.apache.org/r/42073 was also needed for the
`StatusUpdateBenchmarks` and a binding for `ConfigurationManager` was
missing for the `ThriftApiBenchmarks` as-of
https://reviews.apache.org/r/41711/.

While debugging these failures I noticed a new version of jmh had been
released recently, so also upgraded to that.  No changes of import, but
the changelog can be read here:
  http://hg.openjdk.java.net/code-tools/jmh/

Testing Done:
Both of these now work on master:
`./gradlew jmh -Pbenchmarks='StatusUpdateBenchmark.*'`
`./gradlew jmh -Pbenchmarks='ThriftApiBenchmark.*'`

I also checked that a full run of `./gradlew jmh` was now green for
all benchmarks.

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


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

Branch: refs/heads/master
Commit: 0150312ebf93ea89ecf49f00720ac6e5d2f38e99
Parents: c96d5b8
Author: John Sirois <jsirois@apache.org>
Authored: Tue Jan 19 13:14:57 2016 -0700
Committer: John Sirois <jsirois@apache.org>
Committed: Tue Jan 19 13:14:57 2016 -0700

----------------------------------------------------------------------
 build.gradle                                                 | 4 ++--
 .../org/apache/aurora/benchmark/StatusUpdateBenchmark.java   | 8 ++++----
 .../org/apache/aurora/benchmark/ThriftApiBenchmarks.java     | 6 ++++++
 3 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/0150312e/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 169fb25..5b9e015 100644
--- a/build.gradle
+++ b/build.gradle
@@ -604,11 +604,11 @@ jacocoTestReport.finalizedBy analyzeReport
 def jmhHumanOutputPath = "$buildDir/reports/jmh/human.txt"
 jmh {
   // Run specific benchmarks by passing -Pbenchmarks='<regexp' on the command line.  For
example
-  // ./gradlew jmh -Pbenchmarks='ThriftApi.*'
+  // ./gradlew jmh -Pbenchmarks='ThriftApiBenchmarks.*'
   if (project.hasProperty('benchmarks')) {
     include = project.getProperty('benchmarks')
   }
-  jmhVersion = '1.11.2'
+  jmhVersion = '1.11.3'
   jvmArgsPrepend = '-Xmx3g'
   humanOutputFile = project.file("$jmhHumanOutputPath")
   resultsFile = project.file("$buildDir/reports/jmh/results.txt")

http://git-wip-us.apache.org/repos/asf/aurora/blob/0150312e/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java b/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
index 3898596..dc1ef82 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/StatusUpdateBenchmark.java
@@ -39,6 +39,7 @@ import org.apache.aurora.benchmark.fakes.FakeSchedulerDriver;
 import org.apache.aurora.benchmark.fakes.FakeStatsProvider;
 import org.apache.aurora.common.application.ShutdownStage;
 import org.apache.aurora.common.base.Command;
+import org.apache.aurora.common.base.Commands;
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
 import org.apache.aurora.common.stats.StatsProvider;
@@ -195,10 +196,7 @@ public class StatusUpdateBenchmark {
             bind(OfferManager.class).toInstance(new FakeOfferManager());
             bind(TaskIdGenerator.class).to(TaskIdGenerator.TaskIdGeneratorImpl.class);
             bind(SchedulingFilter.class).to(SchedulingFilterImpl.class);
-            bind(Command.class).annotatedWith(ShutdownStage.class).toInstance(
-                () -> {
-                  // no-op
-                });
+            bind(Command.class).annotatedWith(ShutdownStage.class).toInstance(Commands.NOOP);
             bind(Thread.UncaughtExceptionHandler.class).toInstance(
                 (t, e) -> {
                   // no-op
@@ -227,6 +225,8 @@ public class StatusUpdateBenchmark {
             bind(TaskStatusHandlerImpl.class).in(Singleton.class);
             bind(TierManager.class).to(TierManager.TierManagerImpl.class);
             bind(TierManager.TierManagerImpl.class).in(Singleton.class);
+            bind(TierManager.TierManagerImpl.TierConfig.class)
+                .toInstance(TierManager.TierManagerImpl.TierConfig.EMPTY);
           }
         }
     );

http://git-wip-us.apache.org/repos/asf/aurora/blob/0150312e/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java b/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java
index fd182aa..98a124e 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/ThriftApiBenchmarks.java
@@ -27,11 +27,13 @@ import org.apache.aurora.benchmark.fakes.FakeStatsProvider;
 import org.apache.aurora.common.inject.Bindings;
 import org.apache.aurora.common.stats.StatsProvider;
 import org.apache.aurora.common.util.Clock;
+import org.apache.aurora.gen.Container;
 import org.apache.aurora.gen.ReadOnlyScheduler;
 import org.apache.aurora.gen.Response;
 import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.TaskQuery;
 import org.apache.aurora.scheduler.async.AsyncModule;
+import org.apache.aurora.scheduler.configuration.ConfigurationManager;
 import org.apache.aurora.scheduler.cron.CronPredictor;
 import org.apache.aurora.scheduler.quota.QuotaManager;
 import org.apache.aurora.scheduler.state.LockManager;
@@ -149,6 +151,10 @@ public class ThriftApiBenchmarks {
             bind(QuotaManager.class).toInstance(createThrowingFake(QuotaManager.class));
             bind(LockManager.class).toInstance(createThrowingFake(LockManager.class));
             bind(StatsProvider.class).toInstance(new FakeStatsProvider());
+            bind(ConfigurationManager.class).toInstance(
+                new ConfigurationManager(
+                    ImmutableSet.of(Container._Fields.MESOS),
+                    /* allowDockerParameters */ false));
           }
         },
         new AsyncModule(),


Mime
View raw message