You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by ma...@apache.org on 2014/12/11 20:57:26 UTC
incubator-aurora git commit: Adding JMH framework support for
scheduler performance analysis.
Repository: incubator-aurora
Updated Branches:
refs/heads/master a21ab21e2 -> 5542c5561
Adding JMH framework support for scheduler performance analysis.
Reviewed at https://reviews.apache.org/r/28710/
Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/5542c556
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/5542c556
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/5542c556
Branch: refs/heads/master
Commit: 5542c556133bc1292e0a991b9db31f6465a83de8
Parents: a21ab21
Author: Maxim Khutornenko <ma...@apache.org>
Authored: Thu Dec 11 11:57:09 2014 -0800
Committer: -l <ma...@apache.org>
Committed: Thu Dec 11 11:57:09 2014 -0800
----------------------------------------------------------------------
build.gradle | 20 +++++++++++++++-
config/findbugs/excludeFilter.xml | 3 +++
.../aurora/benchmark/SchedulerBenchmark.java | 24 ++++++++++++++++++++
3 files changed, 46 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5542c556/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 152ba63..f9f71a8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -17,6 +17,7 @@ plugins {
id 'com.eriwen.gradle.js' version '1.12.1'
id 'com.github.ben-manes.versions' version '0.5'
id 'com.github.hierynomus.license' version '0.11.0'
+ id 'me.champeau.gradle.jmh' version '0.1.3'
}
apply plugin: 'application'
@@ -154,6 +155,9 @@ project(':api') {
sourceDirs += it
generatedSourceDirs += it
}
+
+ scopes.COMPILE.plus += [parent.configurations.jmh]
+
// These directories must exist, else the plugin omits them from the
// generated project. Since this is executed during the configuration
// lifecycle phase, dependency tasks have not yet run and created
@@ -317,7 +321,7 @@ codeQualityTasks.each {
}
checkstyle {
- sourceSets = [sourceSets.main , sourceSets.test]
+ sourceSets = [sourceSets.main , sourceSets.test, sourceSets.jmh]
}
tasks.withType(FindBugs) {
@@ -435,6 +439,20 @@ task analyzeReport(type: CoverageReportCheck) {
}
jacocoTestReport.finalizedBy analyzeReport
+def jmhHumanOutputPath = "$buildDir/reports/jmh/human.txt"
+jmh {
+ humanOutputFile = project.file("$jmhHumanOutputPath")
+ resultsFile = project.file("$buildDir/reports/jmh/results.txt")
+
+ // JMH run configuration parameters.
+ iterations = 3
+ fork = 1
+ warmupIterations = 1
+}
+tasks.getByName('jmh').doLast() {
+ println "Benchmark report generated: file://$jmhHumanOutputPath"
+}
+
run {
main = 'org.apache.aurora.scheduler.app.local.LocalSchedulerMain'
classpath += sourceSets.test.output
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5542c556/config/findbugs/excludeFilter.xml
----------------------------------------------------------------------
diff --git a/config/findbugs/excludeFilter.xml b/config/findbugs/excludeFilter.xml
index d6c1b16..5ff5f87 100644
--- a/config/findbugs/excludeFilter.xml
+++ b/config/findbugs/excludeFilter.xml
@@ -19,6 +19,8 @@ limitations under the License.
<Package name="org.apache.aurora.gen.comm" />
<Package name="org.apache.aurora.gen.storage" />
<Package name="org.apache.aurora.gen.test" />
+ <Package name="org.apache.aurora.benchmark.generated" />
+ <Package name="org.openjdk.jmh.infra.generated" />
<!-- Un-namespaced structs used by the executor. -->
<Class name="ProcessState" />
<Class name="ProcessStatus" />
@@ -31,6 +33,7 @@ limitations under the License.
<Bug pattern="CN_IDIOM" />
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
<Bug pattern="NM_CLASS_NAMING_CONVENTION" />
+ <Bug pattern="UUF_UNUSED_FIELD" />
</Or>
</Match>
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5542c556/src/jmh/java/org/apache/aurora/benchmark/SchedulerBenchmark.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/SchedulerBenchmark.java b/src/jmh/java/org/apache/aurora/benchmark/SchedulerBenchmark.java
new file mode 100644
index 0000000..5cecada
--- /dev/null
+++ b/src/jmh/java/org/apache/aurora/benchmark/SchedulerBenchmark.java
@@ -0,0 +1,24 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.aurora.benchmark;
+
+import org.openjdk.jmh.annotations.Benchmark;
+
+public class SchedulerBenchmark {
+
+ @Benchmark
+ public void example() {
+ // TODO(maxim): implement benchmark.
+ }
+}